I am working on five interlinked sites running on the same server under different domain names.
The idea is to log in on one of the five domains and the user details to be stored in a session and then the session id to be passed via the url so the other domains can use the same details without the need to login again.
How can I do this?
As long as the sites are sharing the same set of session files then I can't see how there will be a problem. In fact as the sites are on the same machine you can even use the same login detection script for each, I should think.
All the domains use the same scripts, the domain basicly tells the site which template to use.
The problem I'm having is that I can't get all the domains to use the same session files.
Any Ideas would be appreciated
The problem is that the session id is stored in a cookie and one domain cannot access another domains cookies for security reasons.
What I would do is create a single log in script at a single address and have that script take the domain to redirect to as a parameter. Then you can log in to all the domains by logging in once.
What happens when you call session_start() from a script which has access to a valid PHPSESSID? Is a new session created?
No the current session is activated and ready to be used.