Is there any way to make common session for multiple domains on the same server, for sub domains we are using session_cookie so i am able to make common session for sub domains.
please help!!!
Is there any way to make common session for multiple domains on the same server, for sub domains we are using session_cookie so i am able to make common session for sub domains.
please help!!!
You should store you session data in the database, this is accomplished by "rerouting" the save handler to your DB saving functions, like this:
session_set_save_handler ( callback $open , callback $close , callback $read ,
callback $write , callback $destroy , callback $gc )
The callbacks are obvious. if you make a quick search in Google you'll find a bunch of tutorials on the matter, so you won't have to write it from scratch. Also, if you are going to implement your own session class, be sure to read Chriss Shiflett's article "The Truth about sessions"
Below links may help you.
How do I maintain PHP sessions across multiple domains on the same server?
http://www.daniweb.com/forums/thread180252.html
The important thing is that you should have common place for session storage which will be accessed by all domains like database as suggested by david