I am using the cookie based authentication in my javascript client. This is working fine. I use the Credentials Auth, getting the cookie and all all other calls work fine.
But… when I restart my server, the following call in the client code in the browser is getting this Authentication Required popup where you have to enter credentials. How can I avoid this?
Even when I enter credentials in the popup they don’t work.
I tried to intercept this client side, but the popup keeps appearing.
Is there a setting in the server I have to set in order to keep the cookie OK between server restarts? I already give the RememberMe property in the Auth call.
Thanks.
The Session Cookies point to an Authenticated UserSession in the registered ICacheClient, in order to preserve Authenticated Sessions after App restarts it must be configured to use a distributed caching provider (I.e any caching provider except Memory Cache Client). Alternatively you could use a stateless Auth Provider like JWT.
Ok thanks. I am now using the OrmLiteCacheClient and that works fine.
However, I saw that the ExpiryDate is now set to 1 month. Is there a way to have NO expiry on the session.
My idea is that the cookie itself has a long expiry, so I would like to set the expiry of the sessions also to 99 years for example. I saw some docs on extending the session, but when I user does not log on for a month this would not help.
Ok thanks. I am now using the OrmLiteCacheClient and that works fine.
However, I saw that the ExpiryDate is now set to 1 month. Is there a way to have NO expiry on the session.
My idea is that the cookie itself has a long expiry, so I would like to set the expiry of the sessions also to 99 years for example. I saw some docs on extending the session, but when I user does not log on for a month this would not help.
No, that doesn’t override when the Session is saved internally, overriding OnSaveSession() does. If you’re happy for a 10 year Session Expiry you can just override GetDefaultSessionExpiry() instead.