1.

Explain Cookie-less Session in ASP.NET?

Answer»

Sessions are used in ASP.NET applications for state management. Sessions also make use of COOKIES to associate sessions with the correct user. But when BROWSER cookies are turned off then in that case COOKIE-less sessions are used. It APPENDS the values to the browser’s URL that is required to associate with the user.

By default sessions use a cookie in the background, to enable cookie-less sessions, the following settings are required to make in web.config file.

<sessionState cookieless="true" />

The possible options to set cookieless options  are:

  1. UseCookies: cookies are always used.
  2. UseUri: Instead of cookies, use the URL to STORE the session id
  3. UseDeviceProfile: Sessions uses cookies if the browser supports, else URL is used.
  4. AutoDetect: Session uses browser cookies if cookies are enabled else URL is used to store session


Discussion

No Comment Found