TheWizardofInt Posted September 21, 2006 Posted September 21, 2006 Here is the ASP Page: <html> <head> <% Response.cookies ("TestCookie") = "This is a test cookie" %> <% Dim strASPCookie 'as string Dim strASPXCookie 'as string strASPCookie = Request.Cookies ("ResCookie") strASPXCookie = Request.Cookies ("TestCookie") %> </head> <body> The Resolution Cookie is: <%=strASPCookie %> <br /> The Test Cookie is: <%=strASPXCookie %> </body> </html> Here is the ASPX Page: 'in the code behind Dim objTestCookie = Request.Cookies("TestCookie") If Not objTestCookie Is Nothing Then Dim strASPTestCookie As String = objTestCookie.Value Dim lblTestCookie As New Label lblTestCookie.Text = strASPTestCookie pnlSpace.Controls.Add(lblTestCookie) End If 'in the script section in the header <script language="javascript"> <!-- function GetRes(){ var X; var y; var name; x = screen.width; y = screen.height; name="ResCookie" var value = x + "|" + y; var exdate=new Date(); exdate.setDate(exdate.getDate()+1); document.cookie = name + "=" + escape (value) + "; expires=" + exdate; } //--> window.onload=GetRes() I can't read the ResCookie from the ASP page, but it can read the cookie that it just created The ASPX page can read the Javascript created cookie, but not the one created by the ASP page Anyone see somewhere that I am tripping up in this? Quote Read the Fovean Chronicles Because you just can't spend your whole day programming!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.