Reputation: 899
I have an asp.net application in which i redirect from one page to another. I'm validating the SessionID
in the second page to make sure both requests are of the same session. Now, my problem is the SessionID changes whenever a Postback is happened.
Now, I added the Session tag into my web.config
<sessionState mode="InProc" cookieless="true"/>
Now, the problem with the session was solved and a new issue started appearing. Whenever i make a call with Cookiless="true"
in my web.config
file, my URL shows a junk address
http://localhost:10766/(S(ojbcobj0aw0wiosttgpknwby))/registration.aspx
If I remove the Cookieless
tag the session will be lost in the next page?
Do anyone know why is this coming and if any fix is there for this problem?
I went through lot of threads but i couldn't find a proper fix for this.
EDITED:
I Set my cookieless="false"
and now its working fine.
Upvotes: 0
Views: 3935
Reputation: 307
.NET Framework has 05 (five) session state modes:
Now i need to know exactly what does your application do to recommend the better solution:
If you keep your original web.config, by default your application will use InProc mode and will store session id on cookie, unless your browser or local server denied it.
I'm waiting to the answers to complement my post.
Reference: http://msdn.microsoft.com/en-us/library/ms178586.ASPX
Upvotes: 1