Subdomains do not keep login session

5 years ago

DestroPlayer
Member | 2
+
0
-

Hello, my website is http://topstreamers.com

I have working authorization there, but when i created subdomains for users' profile I'm not keeping my login session on this part of site. I'm not logged when I go to any subdomain e.g. pooksie.topstreamers.com

What can i change? I have no idea what should I do.

5 years ago

David Grudl
Nette Core | 6864
+
0
-

Enable cookie for all subdomains via config:

nette:
    session:
        cookieDomain: .example.org

With preceding dot!

5 years ago

DestroPlayer
Member | 2
+
0
-

it works! thank you!

I found also another way to resolve this problem. just put to bootstrap.php:

$container->getService('session')->setCookieParameters('/', '.topstreamers.com');

Last edited by DestroPlayer (2014-05-22 18:50)