Skip to content

Revoke/expire sessions? #2056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
CSchank opened this issue Apr 1, 2025 · 3 comments
Open

Revoke/expire sessions? #2056

CSchank opened this issue Apr 1, 2025 · 3 comments

Comments

@CSchank
Copy link
Contributor

CSchank commented Apr 1, 2025

In the default IHP authentication module, is there any way to revoke sessions? Perhaps after a certain amount of time?

@amitaibu
Copy link
Collaborator

amitaibu commented Apr 1, 2025

I see here an example in the code:

ihp/IHP/FrameworkConfig.hs

Lines 289 to 290 in 16a9275

-- __Example: Set max age to 90 days__
-- > sessionCookie = defaultIHPSessionCookie { Cookie.setCookieMaxAge = Just (fromIntegral (60 * 60 * 24 * 90)) }

So I think on your Config.hs you could

sessionCookie = defaultIHPSessionCookie { Cookie.setCookieMaxAge = Just (fromIntegral (60 * 60 * 24 * 90)) }
option sessionCookie

@CSchank
Copy link
Contributor Author

CSchank commented Apr 8, 2025

Thank you! Is there a way to enforce that current cookies expire? Or will this only work for new logins?

@amitaibu
Copy link
Collaborator

amitaibu commented Apr 9, 2025

I don't think existing cookies can be changed.
But you can expire all of them by changing the session https://github.com/digitallyinduced/ihp-boilerplate/blob/30f5fd22a5d3266bf6840b94ce9a0e11c238e118/flake.nix#L119-L122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants