Solved

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

Posted on 2011-03-23
1
906 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
[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
1 Comment
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 500 total points
ID: 35201799
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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