Hello, I am copying my question on
I have a single rails application running on one unicorn server,
a user can register and create a public profile. This profile is under a
subdomain that the user specifies and a top level domain based on the
country of the user. For example user_domain.appname.gr and
another_user_domain.appname.com.cy and so on.
The ‘appname’ part of the url does not change and the tld length based
country is not fixed. The base domain of the application is appname.gr.
Through that the user can access functionality like searching for public
profiles. He signs in under the appname.gr domain and devise is used
Problem: If he visits another_user_domain.appname.com.cy he will
as non signed in. For *.appname.gr everything is ok.
How the user session gets shared across all domains of the application?
searched about it but it is not clear to me how to solve this. One thing
suspect is that the session must be stored in the database but what
with the cookies? When a user visits *.appname.com.cy and he already has
session and a cookie for *.appname.gr, how I know who is the user to get
Are there any common practices or gems that solve this problem?
Thanks in advance!