Cookieless Sessions

If you know you will be using a Web farm (described in the next section) or you do not want to take a chance on using cookies, you can configure ASP.NET to run without using cookies. You will still be able to use the Session object, but a memory cookie will not be generated. You can accomplish this by changing the Cookieless attribute in the SessionState setting in the Web.Config file associated with the project from False to True. Once you've set this option to True, the SessionID value is added to the URL as shown in the following example:

http://localhost/StateMgmt/(pe5t5r55ay2cqrfpu4tvgm45)/StateBagTest.aspx

The additional text (pe5t…) added to the URL contains the session ID value. IIS uses this number as the session ...

Get ASP.NET Developer's JumpStart now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.