Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8768287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:01:47+00:00 2026-06-13T17:01:47+00:00

I followed advice from this question on how to implement custom IPrincipal (I need

  • 0

I followed advice from this question on how to implement custom IPrincipal (I need it to store userId in it in order to reduce calls to database to get just userId).
Now if I login to site and leave it about 20 minutes don’t do anything on site and refresh page it again requests login.

Does custom implemented IPrincipal has some expirtation time and if it has how to extend this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:01:48+00:00Added an answer on June 13, 2026 at 5:01 pm

    IPrincipal is just a contract that any implementing classes must obey.

    The timeout really depends on the implementation, but a huge consideration on ASP .NET apps should be the formsAuthentication timeout value.

    http://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.timeout.aspx

    This’ll be the time that ASP .NET keeps the session open without input from the user. After that, it’ll retain no information on the logged in user. Most iPrincipal implementations rely on matching Context.User.Identity.Name with an entry in a database. Once the Forms Authentication timeout is hit, that value ( and the IsAuthenticated == true ) status is lost, resulting in the request for a separate login. If you just want a simple extension of the timeout, try tweaking that value first.

    If you’re looking for longer term solutions ( i.e. a “keep me logged in” function ), the most common approach is to send a token to the user’s browser via a cookie, which is checked on consequent visits to the site.

    Typically the strategy here is:-

    • check for cookie
    • pull token value from cookie
    • if matching user found, auto-login the user and give them a FormsAuthentication ticket.

    Article on best practices here:-

    http://jaspan.com/improved_persistent_login_cookie_best_practice

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I followed the advice of this question: Converting Storyboard from iPhone to iPad and
This question stems from this question that I asked yesterday. I've followed Theo's advice
Followed this question about delayed_job and monit Its working on my development machine. But
I followed this tutorial to implement facebook into my application. All I want is
I followed this post http://neurochannels.blogspot.com/2010/05/how-to-run-r-code-in-matlab.html , to install R(D)Com server in order to call
Question regarding how to setup dbase relationships (newbie, this may be trivial) Followed the
I'd like some advice on passing data from form to form. I need to
I have to submit multiple forms, I followed the advice of this post: How
I followed this tutorial . But whenever I try to log in with my
I followed this video tutorial for detecting memory leaks using Instruments with Xcode 4.3.2.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.