Search 
DailyCoding > Web

Implementing Cookieless Session (ASP.NET)

Explains how to implement cookieless authentication in asp.net by settings in web.config
Author admin on May 27, 2008 1 Comments
Rate it    (Rated 5 by 1 people)
588 Views

Cookies are basically text data which a web site may store of the user's machine. Cookies are not considered as safe medium to store data as they could be dangerous in some scenario. Also there might be the case that user has cookies turned off on his machine or the browser doesn't supports the cookies. Our application might get failed if it is depended on cookies support on client side. Most of the time session id is stored at client side in cookies. Therefore we won't be able to retrieve session's data in the case when cookies are not enable.

ASP.NET Cookieless Support

ASP.NET support cookieless execution of the application when the client doens't have cookies support. When to chose cookieless, the session id is transferred via the request url. Each and every request of the application page contains the session id embedded in its url. So the web application need not to request the session from the cookies.

To set Cookieless session in an ASP.NET application set following value in web.config file

<sessionstate cookieless="true" />

When you have cookieless session then the url may look like this

http://www.dailycoding.com/Posts/(_entv9gVODTzHuenph6KAlK07..)/test.aspx
ASP.NET | Web

Discussion

mksamy On Nov 13, 2008 04:17 AM

Leave a Comment

Name
Email Address
Web Site
© Copyright 2008 Daily Coding • All rights reserved