Session.Abandon() confusion.

  • Thread starter Thread starter KK
  • Start date Start date
K

KK

Hi,

I have my sessionstate set to inProc. In web.config
<sessionState
mode="InProc"
cookieless="false"
timeout="1"
/>
to test I have set the timeout to 1 minute

I log in, wait till 1 minute expires and then I click on
a link on the same browser, it works without redirecting
me to the default.aspx page (Which I have defined in
web.config as below)

<authentication mode="Forms">
<forms name=".ADUAUTH" loginUrl="default.aspx" protection="All"/>
</authentication>
<authorization>
<allow users="*" />
</authorization>

Then, even if i press the LOGOUT button in my application
which I do a Session.Abandon() it does't redirect me if I
click on a link after abandoning the session.

What am I doing wrong?

Btw, I got my virtual path problem corrected. Thanks Kevin.
Only issue left there is to stop the default.aspx page loading
to each frame which is ugly.

regards
KK
 
Hi,

Forms Authentication has nothing to do with sessions in general, they have
separate timeoutd and so forth. You need to call FormsAuthentication.SignOut
to log out (remove the authentication cookie). Session.Abandon is the way to
end session programmatically. If you want to be sure, call both of them in
logout procedure.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


Hi,

I have my sessionstate set to inProc. In web.config
<sessionState
mode="InProc"
cookieless="false"
timeout="1"
/>
to test I have set the timeout to 1 minute

I log in, wait till 1 minute expires and then I click on
a link on the same browser, it works without redirecting
me to the default.aspx page (Which I have defined in
web.config as below)

<authentication mode="Forms">
<forms name=".ADUAUTH" loginUrl="default.aspx" protection="All"/>
</authentication>
<authorization>
<allow users="*" />
</authorization>

Then, even if i press the LOGOUT button in my application
which I do a Session.Abandon() it does't redirect me if I
click on a link after abandoning the session.

What am I doing wrong?

Btw, I got my virtual path problem corrected. Thanks Kevin.
Only issue left there is to stop the default.aspx page loading
to each frame which is ugly.

regards
KK
 
Back
Top