You can do: session_start(); $session_id = session_id(); session_write_close();
Lock has been released, now you are free to post $session_id to the other script
N. F. Singh wrote:
Good point. However, the whole point is that I need to pass that session ID so that TST2 can access the same session info TST1 is. Know what I mean? I wonder how I can resolve this...
Thanks for the reply!
----- Original Message ----- From: "Marek Kilimajer" <[EMAIL PROTECTED]> To: "Nicholas F. Singh" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 11:11 AM Subject: Re: [PHP] [sessions] using [sockets]. Very tough!
Nicholas F. Singh wrote:of my php pages from **within** a php program. I have already successfully
Hello all you great PHPers,
Who among you can solve this tricky problem?
OK, a little background: my goal is to send local POST requests to some
done simple POST data transfers with sockets using "HTTPClient.class". This
is not an issue. This class really just prints out the appropriate headers
and receives a server response using sockets -- rather simple.
already have sessions working for "normal" HTTP requests. You can passI am now trying to get php SESSIONS to work with this socketed setup. I
session IDs using cookies or with a POST/GET variable, as you know.
some POST data, and attempts to relay the session id to maintain sessionNow, I've set up two files, "tst1.php" and "tst2.php". TST1 sends TST2
state:
-----------------------#### tst1.php ####---------------------------------------------------------------------------
have in my code, sillyinclude("HTTPClient.class");
session_save_path("mypathtosessions"); //No, this is not what I actually
actually have in my code, sillysession_start(); //Executes a new session.
//Create socket object
$HTTP = new Net_HTTP_Client("mydomain",80); //No, this is not what I
///////////////////////////////////////////////////////////////////////////////////////////////////////
method. If you execute the code below,// (1) GET - This example attempts to send the session ID via the GET
the code will not lock up.// it will "lock" up. However, if you change "PHPSESSID" to, say, "blah",
array( "Bob" => "Jones",// There's some problem, here! $HTTP->Post("/~refcoord/tst2.php?PHPSESSID=".session_id(), // <--
"ID_we_need_to_pass_to_tst2" => session_id()
));
Sure it will lock up. tst1.php has the session file locked for itself, and as you use the same session id, the same session file would be used for tst2.php. You can use different session_save_paths for each file. Or you can let tst2.php set its own session id and get the cookie.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php