Home > Net >  Asp.net core 5 issue of browser cookies failure time
Asp.net core 5 issue of browser cookies failure time

Time:12-10

Before the.net 4, preserve the login information in cookies, set the expiration time, don't persistent, like unless you close the browser, otherwise can keep all the time,

Feeling is the core, the browser may have a is the default for 20 minutes, failure, see the cookies are valid for the session, then how to set up in order to close the browser before failure?

CodePudding user response:

To help you,,,,,,,,,,,

CodePudding user response:

As well,
Also set the session expiration time, I remember in the web configuration in config,
Anyway, no matter whether the core, it should be about the same,

As to whether using a database to store, process or store session, this need you to go back to look at web. Another set of config,

CodePudding user response:

Try this,
 
Public void ConfigureServices (IServiceCollection services)
{
Services. AddSession (options=& gt; {options. IdleTimeout=TimeSpan. MaxValue. });
//...
}
  •  Tags:  
  • C#
  • Related