sessions across web sites

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kernan
Forum Newbie
Posts: 5
Joined: Wed Jan 18, 2006 7:37 am

sessions across web sites

Post by kernan »

Help guys

Is it possible to to have sessions which can afford you to send data/variables across 2 different web sites. If possible, send code showing both how to send and how to receive. By the way I do not mean sessions across pages of the same website, rather across sites themselves.

Secondly how do you resume a session which had been destroyed in case you need some data from it

Kernan
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Post by foobar »

Nope. There's no way to do it via just sessions. You'd have to store the data in the database which is accessible from both servers, and recreate your session from that saved data.
You'd basically be creating a new session for each transfer from one server to the other, but setting the session variables to their respective values from the database.

To answer your second question: You can't. If a session's gone, it's gone. Unless you have implemented your own session handling mechanism.

More on that: http://php.net/manual/function.session- ... andler.php
duk
Forum Contributor
Posts: 199
Joined: Wed May 19, 2004 8:45 am
Location: London

Post by duk »

what type of data you want to use on sessions???

and the databases is one our two ???
Post Reply