Jump to content

Shared PHP Sessions Across Multiple Virtual Hosts


megashell

Recommended Posts

Hi,

 

So I'm having an issue where I have several virtual hosts set up on my server.  Example:

 

localhost (points to htdocs/blah)

localhost:100 (points to htdocs/asdf)

 

localhost has session data that needs to be accessible in localhost:100

 

On my computer, I tested it and it works fine.  I set some session data through localhost/file.php.  Then, I go to localhost:100/test.php, start the session, and the data is there.

 

However, on our working server, this is not the case.  After setting the data and going to localhost:100/test.php, it clears out all the session data.

 

It's as if PHP is recognizing it as a new domain and generating a new SESSID, but the browser sees it as the same in the cookie.

 

ALl that is needed to reset the session data is session_start();.

 

Ideas why it works on my computer but not the server?

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.