User forced to reauthenticate after browser close - AppServiceAuthSession cookie has Expire/Max-Age as Session

Milorad Savcic 71 Reputation points
2024-04-15T09:37:44.07+00:00

I am using Azure container apps and its authentication feature. My use case is to provide users with an authenticated session which lasts as long as possible.

On a previous thread we have pinpointed the issue to the EasyAuthConfig/login/cookieExpiration/timeToExpiration after which I have set it to 30 days and this seems to work fine, but only in the case when the user does not close the browser or if there are browser specific settings which retain tab data.

The issue seems quite obvious now, it is that the AppServiceAuthSession cookie, which is issued after authenticating, has an Expire/Max-Age property set to Session, which explains why the user needs to reauthenticate (the cookie is gone after browser close).

Is there a way to change the Expire/Max-Age property to something else? If not, is there any other way to not force the user to reauthenticate after a browser close, in my use case it is important that users do not reenter credentials so often?

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
325 questions
0 comments No comments
{count} votes