Jump to content

passing sessions between domains on the same server


s0c0

Recommended Posts

Is this possible?  A client of mine has CMS on domain1.com and a seperate one for domain2.com.  I am developing the CMS for domain2 and have made the sessions look the same to facilitate easily moving between the two.  Can I pass the session id through a url or post if they are on the same server?  Do I need to instead use a cookie?  Or is this impossible.  Thanks.

I think this is possible,

you need to use session_set_save_handler to save your sessions to a database

pass session id to the other domain and retrieve session details from the database

 

but you should be careful regarding security, if you pass session id this way it will be easy to hijack your sessions. so extra checks are necessary(IP address, client agent, etc)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.