Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9138965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:19:33+00:00 2026-06-17T09:19:33+00:00

I have a non-unique (other people must have solved this) issue around sessions. The

  • 0

I have a non-unique (other people must have solved this) issue around sessions.

The scenario is that I have 5 top level domains (domain_a, domain_b, domain_c, domain_d, domain_e), and multiple subdomains under each. My app is required to share sessions between subdomains in the same top level domain e.g sub_1.domain_b.com & sub2.domain_b.com can share, but sub_3.domain_c.com would be a different session. To make matters more complex, it would be ideal if domains a & b, and c & d where also to be able to share sessions.

So the rules:

  • domain_a shares session with domain_b, and with all the subdomains
    within them. Happy for this to be in a cookie_store

  • domain_c shares session with domain_d, and with all the subdomains within them. Happy for this to be in a cookie_store

  • domain_e only shares its session within its subdomains. This needs to be in an active_record_store

How can I make this work?

I’ve tried creating an initialiser with the below in:

MyApp::Application.config.session_store :cookie_store, :key => '_domain_a', :domain => '.domain_a.com'

MyApp::Application.config.session_store :cookie_store, :key => '_domain_b', :domain => '.domain_b.com'

MyApp::Application.config.session_store :cookie_store, :key => '_domain_c', :domain => '.domain_c.com'

MyApp::Application.config.session_store :cookie_store, :key => '_domain_d', :domain => '.domain_d.com'

MyApp::Application.config.session_store :active_record_store, :key => '_domain_e', :domain => '.domain_e.com'

However I am not sure that this is working. domain_e.com session works, which would make sense as it is the last declaration, any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:19:34+00:00Added an answer on June 17, 2026 at 9:19 am

    See: What does Rails 3 session_store domain :all really do?
    The selected answer can probably help you to allow common sessions between subdomains and separate sessions between top level domains. To make the same session be valid in different top level domains, is much trickier, but perhaps this question could help you forward: Rails – Multiple top level domains and a single session/cookie

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is the following. There are multiple rows that have non-unique identifiers: id
Can I have an identity (unique, non-repeating) column span multiple tables? For example, let's
I have non-template class with a templatized constructor. This code compiles for me. But
I have a non ode function that calculates based on the previous time step
I have an (non-virtualized) ItemsControl that binds its ItemsSource to a ObeservableCollection of ViewModel
We have a non-profit web site that got about 5 million hits in May.
i have this menu in javaScript: menu[1] = { id: 'menu1', //use unique quoted
I'm very confused with this wee little problem I have. I have a non-indexed
I'd like to subset a dataframe to include only rows that have unique combinations
Hibernate UnUniqueify a column in table(Solved) I want a field set to be non-unique

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.