You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, as the author of the previous question/issue explained:
The abstract session store implementation (lib/rack/session/abstract/id.rb) uses an instance variable, initialized at startup, to determine the name of the cookie it will use to fetch/set a session's id.
Latter, the instance variable is used to fetch the session ID.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We're working on a Rails application that uses subdomains. We need to have a different session for different subdomains:
app.example.com
should use the "default" sessionabc.example.com
should use a session that's only for theabc
domaindemo.example.com
should use a session that's only for thedemo
domainOne potential solution is to change the session key before each request based on the subdomain. The idea is to do that in a middleware.
A similar question was asked before - rack/rack#1155.
The proposed solution was to change the key by accessing the session options:
However, as the author of the previous question/issue explained:
Latter, the instance variable is used to fetch the session ID.
So, changing the session key like this:
Doesn't have any effect on the instance variable.
At the moment, we're using Rack 2.2.8.
Is there something obvious that we're missing? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions