Jump to content

session_start() Question


selenin

Recommended Posts

By default, the session id is propagated between pages using a cookie and ALL cookies are domain specific.

 

To do this between different domains, you would need to pass the session id (or any other identifier) on the end of the url as a GET parameter. Since php won't automatically do this for you across domains, you will need to write the code yourself to do this, which will require that any place where you want to switch between domains, that you rewrite your existing scripts to put the session id onto the end of the URL's.

 

Also, by putting the session id (or any other identifier) on the end of the URL, you are opening up a security hole because people have a habit of copy/pasting links to pages they visit and sending that link to someone else would allow that person to visit your site and appear to be the original logged in person.

Link to comment
Share on other sites

By default, the session id is propagated between pages using a cookie and ALL cookies are domain specific.

 

To do this between different domains, you would need to pass the session id (or any other identifier) on the end of the url as a GET parameter. Since php won't automatically do this for you across domains, you will need to write the code yourself to do this, which will require that any place where you want to switch between domains, that you rewrite your existing scripts to put the session id onto the end of the URL's.

 

Ahh yes, I misread the post.  I thought it was the same domain with the addition of a subdirectory.

Link to comment
Share on other sites

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.