how to sign out forms authentication on session end

D

Dominick Baier

You could handle the Session_End event in global.asax (this works only for
inproc sessions) and call FormsAuthentication.SignOut()

Also sync the forms and session cookie timeout.

I know that SignOut has issues but for what you want to achieve this should
work.
 
J

JohnDeHope3

I will keep this short and sweet.
I am using the default session (inproc) and forms authentication.
When a user looses session (for whatever reason) I want that to cause them
to loose forms authentication also. I want them to be sent to the forms
authentication login screen when they loose their session.
I've poked at it a few different ways, but the fact that I really don't know
how to do this properly is keeping it from working correctly. The closest
I've gotten is to put logic in my base page class, that most pages inherit
from, that checks the session and manually kills forms authentication when
the page loads.
 
J

JohnDeHope3

"You could handle the Session_End event in global.asax (this works only for
inproc sessions) and call FormsAuthentication.SignOut()"
Surprisingly this did nothing at all. I also tries doing the same thing in
Session.Start, but again it did nothing.

"Also sync the forms and session cookie timeout."
This only solves the problem when the session times out. I also want to
handle it when the session is lost for other reasons too. Also such
coordination is shaky at best, the two (session and authentication) aren't
actually synchronized, they just kind of appear to be. I want to *know* that
the authentication will be lost when the session is.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top