Powered by Blogger.

Thursday, March 13, 2014

Cookieless session in Asp.Net



In this post we will discuss what is cookieless session in Asp.Net. Also you can check out my previous posts on:

- List all Stored Procedure Created and Modified in Last N Days in SQL Server 2008

- How to add Eval for hyperlink in gridview in asp.net?

- Session management in Asp.Net

- When the browser is disabled with cookies then the session for the client will not be maintained. Because session id will be sent to the client browser in form of inmemmory cookie.

- The problem has been overcome in Asp.Net by supporting cookieless session.

- When the session id is appended to the URL in the form of Query string then it is called cookieless session.

- To use cookieless session we have to modify in the web.config file like below:

<SessionState -------

Cookieless="ture/false" timeout="20" />

The URL looks like below:

http://-----\(12AB----------)

last is the session id which is appended as querystring parameter.

- When the client makes changes with the URL the session will be lost. This makes a new session to be created for the client.

How to know if browser supports cookie or not:

Request.Browser.Cookies

If it returns true means browser supports cookie and if it returns false then browser does not support cookie.



0 comments

Post a Comment