Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is thre s way to pass a session from

Status
Not open for further replies.

cs7536

Programmer
Apr 20, 2003
130
US
is there a way to pass a session from a page on 1 server to a page on another server, I know u can pass sessions between pages on the same website/server but what if I have 2 servers and I want to pass a session to the other machine.

basicly Iam running a chat server on 1 machine and the site on the other machine so I am trying to pass the user id so that I can make the chat server log the user in with there user name instead of having to type it in manually

please advise, thanks in advance

can't we all just get along

Max
 
yes ... ish

logic is
to serialize the $_SESSION array,
put the serialised string as a url parameter
pick the query param up on the other server
unserialise the array and
assign the values you want to the new session on the other server.
 
I have done exactly what you are talking about by storing the session variables in a common MySQL database. Each server pulls up whatever session variables are available from just the session ID cookie provided by the browser.

It worked really well for me. For information on using MySQL to store session variables, see faq434-2037 titled "Using MySQL to store PHP session variables"





Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top