Hello,
In a LAMP environment, if a user authenticates itself on example.com domain, hosted on server1, how can i keep him logged in on forum.example.com, hosted on server2 ?
Thank you in advance for your advise.
Hello,
In a LAMP environment, if a user authenticates itself on example.com domain, hosted on server1, how can i keep him logged in on forum.example.com, hosted on server2 ?
Thank you in advance for your advise.
One option is to use a database for storing the user sessions that is accessible by both server1 and server2.
Alternatively you could explore 3rd party authentication services like OpenID
There is also the option of relying totally on stored cookies in the client's browser, but thats a bit scary.
You could rely on some Single Sign-on implementation like CAS for instance.
Asked and answered lots of times on Stack Overflow - the solution is to use SSO
A quick and dirty way, is to use cookies for the domain ".example.com" The preceding period will allow the cookie to be accessed by any server in that domain