Can someone please explain what a session cookie is in .NET and how I write data into one?
Thanks,
Sachin
Can someone please explain what a session cookie is in .NET and how I write data into one?
Thanks,
Sachin
Session cookies allow users to be recognized within a website so any page changes or item or data selection you do is remembered from page to page. The most common example of this functionality is the shopping cart feature of any e-commerce site.
copied from AllAboutCookies
Session Cookies
Webpages have no memories. A user going from page to page will be treated by the
website as a completely new visitor. Session cookies enable the website you are visiting to
keep track of your movement from page to page so you don't get asked for the same
information you've already given to the site.
Session Cookies in ASP.Net
When a user connects to an ASP.NET application, a unique session ID will be affiliated
with the user. If nothing is put in the session however, no cookie will be sent to the
browser. This means that the user will get a new session ID the next time a new url is open or
the page is refreshed. If something is put on the session (HttpContext.Current.Session["Hello]
= "hello") however, ASP.NET will issue a cookie called ASP.NET_SessionId. This cookie contains
the user's session ID and the cookie will expire at the end of the session (when you close
your browser).
See this for details
For example;
You visit http://www.blablabla.com/message.aspx and you see Please Login
message.
You login the site. After that, you re-write http://www.blablabla.com/message.aspx in your browser, the automaticly redirecting your message box.
This is happening with Session Cookies
.