2

This is probably a duplicate question, but since I can't find the answer in the questions from the past I am going to ask again.

In my ASP.NET application, when I authorize the user, I set the custom FormsAuthenticationTicket. The persistance variable is false, so the authentication cookie should only be valid for current session.

My question is when would this session end? I restart my IIS Express development server, I shut down the dev machine, etc, and the session seems to be still active and the user is authenticated with that cookie.

How come in my VS 2012 + IIS Express environment sessions are immortal?

2
  • 2
    Cookie "sessions" are browser sessions, not server sessions. Commented Aug 22, 2012 at 13:33
  • Andrew Barber is correct. To end your session close all instances of your browser. Or provide a log out button and click it. Commented Aug 22, 2012 at 13:39

1 Answer 1

2

That's not an issue. You can restart the server and as long as the authentication cookie is still valid, the user is considered logged in. Remember, HTTP is a disconnected protocol.

The cookie will be removed the moment the user logs out and you programmatically remove the cookie or when the user closes his browser.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.