Last active
August 29, 2015 14:24
-
-
Save phpdave/e8bfc5a829dfab982e95 to your computer and use it in GitHub Desktop.
Seperating Session files based on Port #
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In the request both cookies are sent over, but PHP only uses the one it was assigned to in the apache config | |
| Cookies sent over after establishing a session on both ports: | |
| PHPSESSID81=njd6d7nv533amuaq4mu5q722t6; PHPSESSID82=eim233h8qmqt8voa0g9nc2jvf6 | |
| C:\tmp\81\sess_njd6d7nv533amuaq4mu5q722t6 | |
| site|i:81; | |
| C:\tmp\82\sess_eim233h8qmqt8voa0g9nc2jvf6 | |
| site|i:82; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //C:/xampp/htdocs/81/ | |
| session_start(); | |
| $_SESSION['site']=81; | |
| var_dump($_SESSION); //array (size=1) 'site' => int 81 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //C:/xampp/htdocs/82/ | |
| session_start(); | |
| $_SESSION['site']=82; | |
| var_dump($_SESSION); //array (size=1) 'site' => int 82 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Listen 81 | |
| Listen 82 | |
| <VirtualHost *:81> | |
| DocumentRoot "C:/xampp/htdocs/81/" | |
| php_value session.save_path "/tmp/81/" | |
| php_value session.name "PHPSESSID81" | |
| </VirtualHost> | |
| <VirtualHost *:82> | |
| DocumentRoot "C:/xampp/htdocs/82/" | |
| php_value session.save_path "/tmp/82/" | |
| php_value session.name "PHPSESSID82" | |
| </VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment