Jump to content

passing sessions between domains on the same server


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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.