Jump to content

How Do I use session variable across multiple domain or subdomain using php?


Recommended Posts

Could some one tell me how to use session variable across multiple domain.


For example I have created a project in open cart. Need to pass the sessiion variables once user logged in same to another domain





How to achieve this. please someone help me to do this using php

Link to comment
Share on other sites

Sessions are identified by the sessionid. generally the sessionid is stored in a cookie and security rules don't allow you to set a cookie for domain X from domain Y.


However, there is nothing to stop you from making the browser send the sessionid in the URL, from where PHP can set the cookie, making the same sessionfile availably on both domains.

Link to comment
Share on other sites

  • 4 weeks later...
This thread is more than a year old.

Join the conversation

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

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.