Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Pass php sessions to subdomains Re: Pass php sessions to subdomains

#106337
SgtLegend
Member

Even setting a cookie wouldn’t work unless you modified the php.ini file as security measures built into browsers and the PHP core forbid the access of both sessions and cookies that aren’t the same domain as the origin, one thing people are suggesting which i think is risky is saving the session to a database which both domains have access to and redirect the user with a session id as part of the query string in the URL and update the session_id on the new domain.

Personally i feel there is a lot of room for things to go wrong doing it that way so i wouldn’t recommend even trying it but it’s up to you whether you want to or not, apart from that editing your php.ini file is the most assured way to go about doing this.