I'm trying to share a Devise session cookie for authentication purposes between two Rails apps on the same TLD but living on different subdomains. One app is v4.2.11.1, and the other is v6.0.3.2. I want to login on the Rails 4 app, and access the authenticated user info in the Rails 6 app. The session cookie is set fine when logging in on the Rails 4 app, but it seems to get completely wiped out/reset when trying to access it in the Rails 6 app.
- The session store cookie domain is set correctly for both apps, e.g.
.example.com. - The session store
tld_lengthis set to2in both apps. - The cookies serializer is set to
:marshalin both apps. - I'm using the same
secret_key_basein both apps. In the Rails 4 app, it is set via theENV['SECRET_KEY_BASE']env var. In the Rails 6 app, it's set via Rails credentials, e.g.config/credentials/<env>.yml.enc. Devise.secret_keyis the same in both apps.- I'm using the same Devise gem version and initializers in both apps.