Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alexandre Locas 52 posts 219 karma points
    Mar 13, 2022 @ 17:12
    Alexandre Locas
    0

    How to set member authentication expiration timeout

    Hi, in Umbraco V8 we could set member authentication timeout the following way in the web.config file :

    <authentication mode="Forms">
          <forms name="xyz" protection="All" path="/" timeout="15" slidingExpiration="true" />
    </authentication>
    

    How can this be done with v9 when using IMemberManager.PasswordSignInAsync() ?

    Thank you

  • Ambert van Unen 175 posts 819 karma points c-trib
    Mar 14, 2022 @ 07:21
    Ambert van Unen
    0

    You could try setting the Umbraco.Cms.Global.Timeout value: https://our.umbraco.com/documentation/reference/V9-Config/GlobalSettings/

    It's not fully described here, but the first part are settings that are general for users and members, so I reckon this could be it: https://our.umbraco.com/documentation/reference/V9-Config/SecuritySettings/#keep-user-logged-in

  • Alexandre Locas 52 posts 219 karma points
    Mar 14, 2022 @ 11:14
    Alexandre Locas
    0

    Thanks Ambert but those settings seems to affect back office users, not front-end members.

  • Ambert van Unen 175 posts 819 karma points c-trib
    Mar 15, 2022 @ 13:56
    Ambert van Unen
    1

    Hm I tried to jump in code to find something about it, but couldn't find it yet. If you do find a way, don't forget to update this / update the documentation :-)

    Did found out the timeout is 30 minutes by default (you can see that in the yourAuthCookie that's set on logging in to a member area)

    Perhaps they use the default sessionstate from .net core?

  • Joel Mandell 6 posts 78 karma points c-trib
    Mar 15, 2022 @ 23:08
    Joel Mandell
    103

    How about doing this in your Startup.cs:

    services.ConfigureApplicationCookie(options => { options.ExpireTimeSpan = TimeSpan.FromMinutes(30); });

  • Alexandre Locas 52 posts 219 karma points
    Mar 16, 2022 @ 12:23
    Alexandre Locas
    0

    Thank you, this is working great.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies