Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist session across subdomain #70

Closed
yientau opened this issue Apr 24, 2016 · 4 comments
Closed

Persist session across subdomain #70

yientau opened this issue Apr 24, 2016 · 4 comments
Labels

Comments

@yientau
Copy link

yientau commented Apr 24, 2016

In order to make multi-tenancy to work with multiple subdomain, remember to configure config/session.php domain attribute to your domain name.

config/session.php

'domain' => '.lvh.me'

@luceos
Copy link
Contributor

luceos commented Apr 26, 2016

So the use case is you create a user for a newly created tenant website. A good solution would be to create a one time token that the identifies the user on the newly created Tenant website. Simply setting the session domain to allow for any subdomain will only solve this issue in the case of a subdomain set up.

@luceos luceos added the feature label Apr 26, 2016
@yientau
Copy link
Author

yientau commented Apr 26, 2016

Yes, that's right. After a new user was created, I will login the user with

Auth::login($user);

Then a redirection to the user corresponding subdomain site. I am not sure if this will cause any security concern though.

return redirect()->intended("http://" . $tenant_hostname . "/home");

@luceos
Copy link
Contributor

luceos commented Apr 26, 2016

That's fine for the single use case of working with subdomains. In any other case attempting to save a cookie/session for another domain has no effect.

@luceos
Copy link
Contributor

luceos commented May 12, 2017

not going to do this, will consider some solution with the authentication feature for 3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants