Header Ads

ASP.NET Support Cookieless

What is Cookies?

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.

Types of Cookies:

1.Persistent Cookies: Persistent cookies are those which is storing in cookies folder in hard disk.Its called Permanent Cookies.

2.Non Persistent Cookies : Non persistent cookies is created on memory, inside the browser process. When we close the browser, that memory region will collect by Operating system, and the cookie will also deleted.Its called Temporary Cookies.

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.w3technology.info/Posts/(_entv9gVODTzHuenph6KAlK07..)/test.aspx           
       
 

No comments:


Powered by Blogger.