ASP.net session id changing on each request

G

Guest

I have working on WinXP + IIS 5.0 + .NET 1.1

Whenever i open a page with the url starting as http://localhost/<page
address> or http://127.0.0.1/<page address> the application to hold session
values. Session id changes on each request. But when I try with the network
ip like http://10.10.10.10/<Page address> (where 10.10.10.10 is localhost
itself) it works fine. session id remains same.

I am using session mode as InProc in web.config and my browsers always
accepts session cookies.

Can anyone please help me out to run with <localhost>.?

Samik
 
G

George Ter-Saakov

Session is based on cookies sent by browser
For browser http://127.0.0.1 and http://10.10.10.10 are 2 different web
servers (even if they are physically same server).

Because of that cookies that were established with 127.0.0.1 are not sent to
10.10.10.10 and vise versa.


So I bet that in your situation there is a redirect from 127.0.0.1 to
10.10.10.10 at which point your session is lost.


George.
 
G

Guest

I am not redirecting from 127.0.0.1 to 10.10.10.10..

I was trying to access the same web once using localhost or 127.0.0.1 which
resulted insession loss

A different try using 10.10.10.10 which worked correctly
 
G

George Ter-Saakov

I can not come up with any other reason.
You can download fiddler from http://www.fiddlertool.com
and investigate header information.


But keep in mind that Session will be lost if you are changing server name.
Even www.mysite.com and mysite.com considered as 2 different sever names
(actually depends on a browser version).

George
 
Joined
Jul 11, 2007
Messages
1
Reaction score
0
suggestion to the same sessionid and my trouble

You may edit related configuration in your file web.config like this:
<sessionState mode="InProc" cookieless="true" />
just don't use cookie-suportted session.

But in my case,even I set cookieless="false",I'll get the same SessionId in every page request. The worse is , I 'll get the exact same sessionid even if I open another new browser window to visit the same url. Any one can help me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top