Solved

ASP.NET Membership - Force user back to login page when login expires

Posted on 2011-03-23
1
885 Views
Last Modified: 2012-08-14
I'm using ASP.NET membership provider for the first time in a web application so I'm not extremely familiar with all of it's inner workings.

I basically have 2 issues...
1) I'm not sure how long a user is supposed to stayed logged in by default, but the login doesn't ever seem to expire.  How is this configured?
2) When a login is expired, or when a user logs out, how do I make it force the user back to the login page?  Do I have to write code for this or is there a way to set it up in the web.config so it will happen automatically.

Thanks.
0
Comment
Question by:JosephEricDavis
1 Comment
 
LVL 19

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
Comment Utility
Follow this article for more information on forms authentication, but the timeout is set in one of two places:  The web.config or in the actual callto FormsAuthenticateTicket.  If the call to FormsAuthenticateTicket has a timeout in it, then it takes precedence and whatever you put in the web.config is ignored:
http://support.microsoft.com/kb/301240

Your second question is best answed by this article:
http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.signout(v=VS.90).aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now