Cookie unset on response.redirect

zzztorzzz

New Member
I am trying to create a login page with the ability to persist user login info (User ID/User Name) in cookies (although a session variable is used for immediate storage for the site). I am using the code below:\[code\] Session("UserID") = USERS.GetUserID(Request.Form("UserName")) Session("FullName") = USERS.GetUserFullName(Session("UserID")) If Request.Form("RememberMe") = "True" Then Response.Cookies("UserID").Value = http://stackoverflow.com/questions/15511124/Session("UserID").ToString Response.Cookies("UserID").Expires = Now.AddDays(30) Response.Cookies("FullName").Value = http://stackoverflow.com/questions/15511124/Session("FullName").ToString Response.Cookies("FullName").Expires = Now.AddDays(30) End If Response.Redirect("~/VetPortal/Default.aspx")\[/code\]I can track this step by step using Visual Studio and everything works just fine. The session variables are set, and the cookies are created properly. The problem is that when the redirect page is loaded, the cookies no longer are present. Am I missing something in setting the cookies that are preventing them from being retained? As I understand it, they should be retained until the expiration (today + 30 days).
 
Back
Top