Is this right way to save a cookie across several pages in one web folder?
It does not seem to be working
what is wrong?Code:Response.Cookies("LoggedIn").Value = 1
Response.Cookies("LoggedIn").Expires = Now.Date.AddHours(1)
Printable View
Is this right way to save a cookie across several pages in one web folder?
It does not seem to be working
what is wrong?Code:Response.Cookies("LoggedIn").Value = 1
Response.Cookies("LoggedIn").Expires = Now.Date.AddHours(1)
Hello,
As per the documentation here:
http://msdn.microsoft.com/en-us/libr...kies101anchor5
Specifically the "Writing Cookies" section, what you are doing "should". Do you have cookies enabled on your browser?
Gary
hay,
as Gary asked you, you have to check if the cookies enabled into your browser
your codes didn't add any cookies yetCode:if(Request.Browser.Cookies)
{
/// this means it is enabled and supported in your browser
}
else{
/// means not supported
}
Code:// to add your cookie
Response.Cookies.Add("LoggedIn");