Reputation: 15096
I'm experiencing an odd behavior on ASP.NET <sessionState>
configuration.
I'm trying to use mode="SQLServer"
.
When I put cookieless="true"
everything works happily as it should be and the ASPStateTempSessions
table get filled as expected.
When cookieless="false"
ASP.NET simply ignore my configuration and host the sessions in its process (nothing on ASPStateTempSessions
).
I have no idea why the cookieless
configuration is yielding such unexpected behavior.
Anyone know why this happens or how do I solve it?
By the way here's my configuration:
<sessionState mode="SQLServer" allowCustomSqlDatabase="true" sqlConnectionString="MyConnectionString" />
P.S.:
I've double checked my browser cookies, it's definitely nothing to do with my browser.
I also tried to use a custom implementation just to for the sake of testing.
The exact same behavior happens, only works with cookieless="true"
.
Upvotes: 0
Views: 1089
Reputation: 62228
When cookies are used in the web.config the session will not be created on first use until something is persisted to the session object. This means that the database will not be updated and the cookie will not be written to the server. You can test if this is the case by writing some dummy value back to the Session object and then checking to see if the database record has been created and the cookie written to the browser.
Upvotes: 1