Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: ASP.NET
Expertise: Intermediate
Mar 2, 2005



Building the Right Environment to Support AI, Machine Learning and Deep Learning

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:

<a href="enquiry.aspx">enquiry</a>
<a href="enquiry/enquiry.aspx">enquiry</a>
While the following absolute URLs will work, you'll lose the Session value if you use them.

<a href="/enquiry.aspx">enquiry</a>
<a href="http://www.myapplication.com/enquiry.aspx">enquiry</a>
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.
Jaya Nehru Kumar
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date