R
Rof
I am using FormsAuthentication.RedirectFromLoginPage(...) to give my
users a cookie, but I want to include other bits in the cookie, like
their name, what they are asking for, and so on. I have this in
Login.aspx:
System.Web.Security.FormsAuthentication.RedirectFromLoginPage("Peter",
True)
Response.Cookies("Peter").Expires = Now.AddSeconds(60)
Response.Cookies("Peter")("whoami") = "Anon"
In the form it redirects to, I can only access
'Request.cookies("Peter")("whoami")' until the cookie expires - which
is logical. However, I still get sent straight there (no Login.aspx)
after the 60 seconds have expired. Does thes mean I have 2 different
cookies? If so, how can I get "whoami" and the expiry time into the
correct, FormsAuthentication cookie?
If the last 2 lines of code are these:
Response.Cookies(0).Expires = Now.AddSeconds(60)
Response.Cookies(0).Values.Add("whoami", "Anon")
Then it won't authenticate me at all, but keeps re-displaying
Login.aspx.
Help!
Peter Royle
users a cookie, but I want to include other bits in the cookie, like
their name, what they are asking for, and so on. I have this in
Login.aspx:
System.Web.Security.FormsAuthentication.RedirectFromLoginPage("Peter",
True)
Response.Cookies("Peter").Expires = Now.AddSeconds(60)
Response.Cookies("Peter")("whoami") = "Anon"
In the form it redirects to, I can only access
'Request.cookies("Peter")("whoami")' until the cookie expires - which
is logical. However, I still get sent straight there (no Login.aspx)
after the 60 seconds have expired. Does thes mean I have 2 different
cookies? If so, how can I get "whoami" and the expiry time into the
correct, FormsAuthentication cookie?
If the last 2 lines of code are these:
Response.Cookies(0).Expires = Now.AddSeconds(60)
Response.Cookies(0).Values.Add("whoami", "Anon")
Then it won't authenticate me at all, but keeps re-displaying
Login.aspx.
Help!
Peter Royle