Base solution for your next web application
Open Closed

RE: Remeber me (logs out after 24 hours) #4075


User avatar
1
paradoxit created

Hi,

When you tick remember me, no matter how much you use the website you still get logged out exactly 24 hours from login.

Can you advise how to make it so every page request resets this counter?

Kind regards, David


4 Answer(s)
  • User Avatar
    0
    alirizaadiyahsi created

    Hi @ParadoxIT,

    Fitst, this is not directly releated to asp.net zero, this is a general .net question, actually.

    There is almost the same question in HERE

    And detailed answer (with article): <a class="postlink" href="https://stackoverflow.com/a/29669019/1324756">https://stackoverflow.com/a/29669019/1324756</a> And quick answer: <a class="postlink" href="https://stackoverflow.com/a/27789708/1324756">https://stackoverflow.com/a/27789708/1324756</a>

    The following line is the best match for your issue, I think:

    await UserManager.UpdateSecurityStampAsync(userId);
    
  • User Avatar
    0
    paradoxit created

    Hi,

    Thanks for the quick response I'll read the articles now.

    Kind regards, David Hawkins

  • User Avatar
    0
    paradoxit created

    I'm using the Angular + ASP.Net version of the site and can't seem to find any reference for:

    SecurityStampValidator or app.UseCookieAuthentication

    Can you please advise what code changes are need for the Angular4 project? Having the website log out exactly 24 hours after login is very frustrating for end-users.

    Thanks in advance, David

  • User Avatar
    0
    alirizaadiyahsi created

    There is a method in *.Web.Core\Controllers\TokenAuthController.cs file that named CreateAccessToken(). Token is created by this method and this method is getting a parameter that named expiration. You can change this token expiration time of token.

    And also, default expiration time is set in *.Web.Core\AbpZeroTemplateWebCoreModule.cs file by ConfigureTokenAuth() method.