Click here to Skip to main content
15,888,218 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
dear

i have make cookes and use like this

VB
cokee("name") = "Welcome:" & vbTab & reader("fname") & vbTab & reader("lname")
Response.Cookies.Add(cokee)
Response.Redirect("jobdetail.aspx")


and it works but it lost cokees after restart browser
Posted

check following link to set expiry time to cookies

Beginner's Guide to ASP.NET Cookies[^]
 
Share this answer
 
You need to set an expiry date to make it persistent across session.

Do something like this:

HttpCookie myCookie = new HttpCookie("myCookie");
myCookie.Expires = DateTime.Now.AddHours(12);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900