Link to home
Start Free TrialLog in
Avatar of gdspeare
gdspeare

asked on

ASP Session ID

I am using a cookieless session id.  My issue is that every page in my application is assigning a new session id when a page is new page is loaded.

I can't seem to figure out how to use the same active session for every page in the instance.

Thanks
Avatar of devlab2012
devlab2012
Flag of India image

How are you opening new pages - 1) through links or by typing the urls, 2)in same tab, in new tab or in new window?

If you open different pages in same tab, then everything should work fine. But in different tabs, you may face problem.
Avatar of gdspeare
gdspeare

ASKER

new pages are opened from the menu in the same tab.

and new session ids are being given.
Then I think that you are using absolute URLs or relative to application root.

I tried it this way: Created two pages Page1.aspx and Page2.aspx in same folder. On Page1.aspx, i added two links to page Page2.aspx as:

<a href="Page2.aspx">Link 1</a>    
<a href="/Page2.aspx">Link 2</a>

If I click on Link 1, it uses the same session id. But if I click Link 2, it assigns a new session id.

I am not sure but it seems that this behavior is by design and probably we cannot change it.
Although its not exactly the solution to your problem, but it will help you understand a bit about cookiless sessions.
Just found on an article that we can use absolute urls like this:

<a runat="server"
    href=<% =Response.ApplyAppPathModifier("/Page2.aspx")%> >Link 2</a>


Here is the link to that post:

http://msdn.microsoft.com/en-us/library/aa479314.aspx
ASKER CERTIFIED SOLUTION
Avatar of devlab2012
devlab2012
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial