Forums

ASP

This topic is locked

Problems with Cookies

Posted 13 May 2008 21:33:25
1
has voted
13 May 2008 21:33:25 Jamie Kathol posted:
I'm trying to build what I assumed would be a simple script that writes a cookie, with its expiration and then display it later. Sounds painfully simple. I'm able to write the cookie just fine and I can view the cookie in Firefox and see its expiration date is far into the future. The cookie displays just fine while the current session is open. The problem comes in when I try to display the cookie later, after the window has been closed a re-opened. I can still see the cookie with the expiration date far into the future but the cookie is displaying as blank. My code for creating the cookie is as simple as follows:

<%
Response.Cookies("test_cookie" = Session("test_session"
Response.Cookies("test_cookie".Expires = Date+365
%>

and this is the display:

<%
Request.Cookies("test_cookie"
%>

This just seems like it should be so painfully easy I can't figure out why it doesn't work. Any help is greatly appreciated.

Reply to this topic