23358 Posts in 18005 Topics by 2862 members
|Go to End|
1 November 2009 at 6:00pm
I need to know how to get silverstripe login session so it can work across subdomains.
For example if i logged in to : www.website.com, i need it still to be logged in when i change the url to subdomain.website.com
What i have tried is :
Add this line on sapphire/main.php :
ini_set ("session.cookie_domain", ".website.com");
But it's not working, even the Security/login is become not working(seem like no session created), please help with this, any help would be appreciated.
20 May 2011 at 11:10pm
In order to set the session.cookie_domain, you should use the set_cookie_domain static method from Session class.
I put this in _config.php to avoid call this method in multiple pages (site entry points).
And, you should also remove the Session::start() from your code below since it is not needed.
|Go to Top|