SessionID Changes in production machine....help

G

Guest

Help,

I posted another thread here asking help because I was losing my session
information(got no response). After a lot of searching on different sites I
discovered that my sessionID changes everytime I submit.
It doesn't happend with running it inside the visual studio, just when
running it as a site directly with IE.
Anyways, I found out if I set
cookieless="true"
it solves the problem. However I am not happy with this solution even though
I don't use cookies, but I have another project
with cookieless="false"
that works just fine.

So I like to hear some suggestions/insight on this from those experts out
there to at least understand why or find a solution.

thanks in advance,
Reza
 
J

Juan T. Llibre

Is your browser configured to accept cookies ?

If it isn't, ASP.NET will interpret each access
as coming from a new browser.

cookieless="true" enables ASP.NET to maintain state
even if the browser isn't configured to accept cookies.

cookieless="false" works only if the browser accepts cookies.

Everything is working as it should. It's your call to make.
Your choice.
 
G

Guest

My browser is configured to accept cookies, so really I shouldn't have to
change the setting of cookieless from default value of false to true!

So the question is, is there some thing else that could cause the sessionid
to keep changing with each sumbit?
 
J

Juan T. Llibre

re:
is there some thing else that could cause
the sessionid to keep changing with each submit?

There is nothing that could cause that, except the cookieless setting.

1. Make sure your web.config syntax is correct.

2. Check your browser settings again.

Are you using InProc Session State ?
 
G

Guest

Juan,
Here is the exact code:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
as it gives the problem, but when I change the cookieless="true" it works
fine.
However, I have another project with the same exact setting that uses
cookies which works fine!? (so it couldn't be the browser settings)

Just one more thing, this problem started/noticed when I added a 2nd grid to
some of my pages where the arraylist feeding the grid is being kept in
session till finalized to database.
 
J

Juan T. Llibre

re:
Just one more thing, this problem started/noticed when I added
a 2nd grid to some of my pages where the arraylist feeding the
grid is being kept in session till finalized to database.

Aha! The mystery begins to unravel.

Not having your code to look at, I can only suggest that you
start tinkering with it, until you find the reason for the sessions
being reinitialized.

Maintaining state in objects stored in the Session Object is tricky.
 

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,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top