Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

How to use with a session store #132

Closed
erewok opened this issue Nov 23, 2018 · 3 comments
Closed

How to use with a session store #132

erewok opened this issue Nov 23, 2018 · 3 comments

Comments

@erewok
Copy link
Contributor

erewok commented Nov 23, 2018

Hi all,

I've been using this library on one of my personal projects where I was experimenting with running a handful of docker containers. I noticed that when I ran three instances of my application, my session would sometimes show me as logged-out, but if I just refreshed the browser, I'd be logged in again. When I went back to a single container, this problem went away.

I did not do extensive debugging on this, but it occurred to me that in the past I've typically used memcached or redis to store sessions for applications, and these sessions are reachable by any instance of the application. Is it possible to do this with servant-auth-server or are there plans to support caching sessions in a data store?

Thanks.

@domenkozar
Copy link
Collaborator

Do you share the key you pass into defaultJWTSettings :: JWK -> JWTSettings between those instances?

Which auth type are you using? :)

@erewok
Copy link
Contributor Author

erewok commented Nov 23, 2018

I did not share the key and realized after the fact that that would most likely be my issue. I suppose that I could first generate the key and pass it into the app as an environment variable.

This may be something worth mentioning in a tutorial?

I was using Cookie auth.

@domenkozar
Copy link
Collaborator

Added to #129 list, thanks.

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

No branches or pull requests

2 participants