Closed z3ugma closed 3 years ago
@z3ugma thank you for the hints. This is what I did mapped to your example:
As I don't want to pollute my application.rb with additional setup, I've created a separate file in initializers called _config/initializers/sessionstore.rb for session setup:
Rails.application.config.session_store :cookie_store, expire_after: 1.year, key: "_mise_session"
Your solution was almost right, but you have to consider:
_session_id_
as name by default, until you define a key (see above) for this.config.always_write_cookie = true
. Making life easier in development, privacy thing and don't set anything until you have to. If it is set, it hast a reason.Hope it'll help solve your problem.
Hello! I'm having a really hard time debugging this one.
My intended behavior would be that once the user clicks the login link sent to their email, they stay logged into that browser forever or until they visit the logout link.
Currently, users are logged out in under 12 hours (timing not exact), even when the browser session stays open.
Here is some of my setup:
Initializer
config/initializers/passwordless.rb
The user ends up with these cookies:
There is a further configuration in
config/application.rb
:I see the
_session_id
cookie which expires in 1 year, which I expect is coming from the Rails :cookie_store, and the_mise_session
which I expect is from Passwordless, with an expiration of Session.I'd like the Passwordless cookie to have near-permanent cookie persistence, and persist even after the browser tab has been closed. I don't understand why users are being logged out after ~12 hours even when the browser stays open, however.