megashell Posted July 20, 2009 Share Posted July 20, 2009 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? Link to comment https://forums.phpfreaks.com/topic/166647-shared-php-sessions-across-multiple-virtual-hosts/ Share on other sites More sharing options...
megashell Posted July 20, 2009 Author Share Posted July 20, 2009 One note: It isn't actually changing the session ID. They remain the same between localhost and localhost:100, however the contents of $_SESSION is cleared out Link to comment https://forums.phpfreaks.com/topic/166647-shared-php-sessions-across-multiple-virtual-hosts/#findComment-878783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.