Click to See Complete Forum and Search --> : cookies problem


jabbarsb
07-19-2006, 08:41 AM
hi friends,
i want to set a cookie from my vb.net page ie server side and retreive the cookie in html page how can i do this
regards jabbar

Sync
07-20-2006, 02:44 AM
CodeBehind
HttpCookie myCookie = New HttpCookie("LastVisit");
Response.Cookies.Add(MyCookie);

HTML
<% Response.Write(Response.Cookies[0].Value.ToString()); %>
Aniway, it's the same as writing in codebehind file. :-)

retreive the cookie in html page
Retreiving the cookie by using client script (i.e: JavaScript)?

Sync
07-20-2006, 05:15 AM
I just posted about writing cookie from codebind file and reading the vulae of cookie from Javascript.
Chk it out..
http://michaelsync.wordpress.com/2006/07/20/using-cookie/