Ben Sinclair wrote:
>I want to retain some data across my sites, which have different domain names.
>pass the information on every link Any suggestions?
I've been thinking about this recently and here's what I came up with:
Have a domain or subdomain dedicated souly to user sessions, for
Whenever a user visits a page on ANY of your domains (currentdomain.com
in this example), check if they have a cookie set. If they don't:
1. Create a session for that user with a unique session ID
2. Send them a page which includes a single pixel gif image looking like
( Remember - session.yourdomain.com has access to ALL cookies set for
3. session.yourdomain.com CHECKS to see if this user has a cookie set.
If they DO then they are already
known to session.yourdomain.com - session.yourdomain.com records the
fact that this user is logged on to
currentdomain.com as zs9s0a8fs6fudisdfsf8dfdfsfs in a shared database.
4. If session.yourdomain.com does NOT find a cookie then it means this
is a new user who is not "known" to the system yet.
session.yourdomain.com creates a cookie recording the user, and
notes that the user is also logged in to currentdomain.com with
whatever session ID was set over there.
This is all pretty complicated but the end result is that the
session.yourdomain.com domain knows about every user, and a shared
database (accessible by all of your domains) maintains a record of each
unique user (as according to the session.yourdomain.com cookie) and what
their session is for each of the different domains.
Final note: http://session.yourdomain.com/pixel.php needs to actually
send a pixel to the client browser - this can be done with the following
code in the zend code library: http://www.zend.com/codex.php?id=193&single=1
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php