Hi,
I was wondering if there was a way to allow users to log into multiple sites at once using sessions.
It is just 2 urls at the moment and they are on the same server, so I have been wondering it it's possible to trick php into sharing the sessions (or session files) between the to sites?
Sessioons and Logging in to multiple sites?
Moderator: General Moderators
-
phpfreak
- Forum Commoner
- Posts: 30
- Joined: Fri Mar 21, 2003 10:28 am
- Location: New Jersey,USA
- Contact:
I think the best solution would be to store the usernames and session created on them in a text file and then by having your open_basedir=on(if it is in the same server but different directory) and your allow_url_fopen=on(if the url of the text file is in other protocol),you can access this file and give the user the permissions to use any directory depending on the sessions listed in the text file. then you can use the fopen function to write the session to the text files or destroy them from the text files.
Ok, half of the problem solved...
Two option have presented... One was in one of someones posts to the PHP manual (doh!)..
For sites that share same domain:
Ooo I wonder what would happen if I put .com or .uk for the domain
The second is playing with the setcookie function and setting a cookie for every domain I want the session to work for
Two option have presented... One was in one of someones posts to the PHP manual (doh!)..
For sites that share same domain:
Code: Select all
session_set_cookie_params( time()+9999999, "", ".domain.com");The second is playing with the setcookie function and setting a cookie for every domain I want the session to work for