Hello Ujwal,
Thank you for posting your query on Microsoft Q&A.
I understand that you would like to have the browser cookies session expire after 15 minutes of inactivity.
Please note that cookies session timeout is controlled by features in Azure B2C; KeepAliveInDays and SessionExpiryInSeconds. Once the KeepAliveInDays isn't enabled, then the SessionExpiryInSeconds handles the session timeout which is the case here.
However, I noticed that you set the SessionExpiryType to Rolling which indicates that the session is extended every time the user performs a cookie-based authentication. This is the default behavior.
To resolve this, kindly change the SessionExpiryType to Absolute which indicates that the user is forced to reauthenticate after the period specified. Also, make sure you aren’t passing the parameter prompt=login to AAD B2C.
Follow this link (https://learn.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-custom-policy#configure-azure-ad-b2c-session-behavior) to learn more about information about Azure AD B2C Session behavior.
Ensure that these settings are placed in the correct location within your policy. Typically, session expiry settings should be within the OrchestrationStep
that handles the sign-in and the MFA part. If it’s placed in the wrong part of the policy, it might not be applied where expected.
So, the solution is to look at the token lifetime behavior.
The default is 60 minutes (1 hour). The minimum (inclusive) is 5 minutes. The maximum (inclusive) is 1,440 minutes (24 hours).
So kindly set your token lifetime to 15 mins. This should be Access and ID token lifetimes
Follow this link https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-tokens?pivots=b2c-custom-policy to get more information about this.
You can configure the Azure AD B2C session behavior, including:
Web app session lifetime (minutes) - The amount of time the Azure AD B2C session cookie is stored on the user's browser after successful authentication. You can set the session lifetime up to 24 hours.
Web app session timeout - Indicates how a session is extended by the session lifetime setting or the Keep me signed in (KMSI) setting. Rolling - Indicates that the session is extended every time the user performs a cookie-based authentication (default). Absolute - Indicates that the user is forced to re-authenticate after the time period specified.
For more details you can refer this QnA post on same issue:
1.https://learn.microsoft.com/en-us/answers/questions/1347290/understanding-b2c-web-app-session-timeout
2. https://learn.microsoft.com/en-us/answers/questions/1103098/azure-ad-b2c-custom-policy-saml-token-lifetime-ses
Documents: https://learn.microsoft.com/en-us/azure/active-directory/develop/refresh-tokens#token-timeouts.
More info https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/token-lifetimes.md#token-lifetimes-expiration-and-renewal
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/4056#issuecomment-917246299
I hope this clarifies things.