Solved

ASP.Net End Session

Posted on 2008-10-28
3
203 Views
Last Modified: 2012-05-05
How can i end the user session when the browser closes. I have noticed sometimes when i close the browser and reopen it still shows me as logged in but all my session variables are gone. How can i do one of the following

Keep the seession objects or log the user out so they have to log back in.

Thanks
0
Comment
Question by:jimseiwert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 20

Expert Comment

by:Juan_Barrera
ID: 22826843
Hi,
You can set both Session and Authentication time outs to the same value, like the following:

In web.config:

<sessionState mode="YourValue" timeout="30" />
<authentication mode="Forms">
          <forms timeout="30" moreValues="","","" />
</authentication>
0
 
LVL 16

Accepted Solution

by:
ororiole earned 500 total points
ID: 22827040
Are you using Forms authentication? If so, when you save your auth cookie, SetFormsAuthCookie(), set persistent cookie to false. Then, when they close the browser the cookie is gone and they will have to log in again. The syntax is very close to this: SetFormsAuthenticationCookie(cookie, false);
0
 
LVL 2

Author Closing Comment

by:jimseiwert
ID: 31510964
That was it, thank you
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question