Use Cookieless Sessions with Care

Use Cookieless Sessions with Care

When a user visits a Web site for the first time, the site creates a unique ID, known as a Session ID. The Session ID is unique for that current Session, making it possible for the server to keep track of the user’s current Session information.

The Session ID is usually stored in the user’s cookies, using settings, like the following, in web.config:


If you decide to use a cookieless session, the session ID is, instead, stored as part of the URL, like this:

If you do this, you must remember to use relative path URLs when linking between the pages of the Web site. Like this:


While the following absolute URLs will work, you’ll lose the Session value if you use them.


This is because absolute URLs automatically generate a new Session ID, so the existing Session ID is lost, along with all of its Session data.

See also  5 Ways to Improve Customer Experience

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist