Copied to clipboard

Flag this post as spam?

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


  • pikapokec 1 post 21 karma points
    Oct 23, 2023 @ 07:46
    pikapokec
    0

    Backoffice auto logoff

    We are using Umbraco 11 for frontend and experiencing an annoying backoffice auto logout after 30 minutes, even if you are using frontend. Tried many things. Tried also version 12.

    Startup.cs

        var builder = services.AddUmbraco(_env, _config)
            .AddBackOffice()
            .AddShop()
            .AddWebsite()
            .AddComposers();
    
        services.ConfigureApplicationCookie(options =>
        {
            options.ExpireTimeSpan = TimeSpan.FromMinutes(120);
            options.SlidingExpiration = true;
        });
    
        services.AddSession(options => options.IdleTimeout = TimeSpan.FromMinutes(120));
    

    Extending MemberSignInManager.cs

    public override Task SignInWithClaimsAsync(MemberIdentityUser user,
        AuthenticationProperties? authenticationProperties, IEnumerable<Claim> additionalClaims)
    {
        var ts = TimeSpan.FromMinutes(120);
        authenticationProperties.ExpiresUtc = DateTimeOffset.Now.Add(ts);
        authenticationProperties.AllowRefresh = false; // tried with true
        authenticationProperties.IsPersistent = false; // tried with true
    
        return base.SignInWithClaimsAsync(user, authenticationProperties, claims);
    } 
    

    appsettings.json

      "Umbraco": {
        "CMS": {
          "KeepAlive": {
            "DisableKeepAliveTask": false,
            "KeepAlivePingUrl": "~/api/keepalive/ping"
          },
    

    Web.config

    <configuration>
        <system.web>
            <compilation debug="true"  />
            <httpRuntime  />
            <sessionState mode="InProc" timeout="120"></sessionState>
            <authentication mode="Forms">
                <forms timeout="120" />
            </authentication>
        </system.web>
    </configuration>
    

    Can anybody give us some suggestions?

Please Sign in or register to post replies

Write your reply to:

Draft