Hi John,

I've tried your suggestion and yes, I am transferring the SID variable to
the next page... but I don't know if I am doing the this right.

This is the code I use:
---
<?php
session_start();
$SID = session_id();
echo $SID;
?>

<a href="http://192.0.1.7/use.session.php?SID=<?php echo
$SID?>">LinuxBox2</a>
---

This seems to work, since when I open the page on LinuxBox2, <?php
$_GET['SID'];echo $SID ?> will return me the same SID, without doing any
session_connect, msession_create, etc (according to the LITTLE documentation
there is, this should be correct... right?).

Where I get confused is that I thought that we needed to do a
session_start() at the beginning of each pages (to get a working session),
and that if you already had a working session session_start() would return
you this ID, unchanged, and if you did not have any started, session_start()
would create you a new one. When I do this on the second page of the example
above, I always get assigned a new SID: am I using msession properly?

Then I started doubting that maybe I had to use msession_connect/create/etc
to get this working (even if the docs said "If msession is used as the PHP
session handler, this call should not be made.", which is the case of my
php.ini)... but alas, nothing improved, it even got worst: $SID was
inexistent... so the documentaion was right after all.

So to recap:
1- Do I need session_start() at the beginning of each php pages?
2- Do I need msession_connect/create?
3- Am I right to use $SID as a good tracking assumption (if I get the same
SID thru several pages, this means msession works well???)?

Thanks to all in advance, your help is greatly appreciated,
Guillaume

-----Original Message-----
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 3:16 PM
To: Guillaume Dupuis; [EMAIL PROTECTED]
Subject: Re: [PHP] msession - giving me a hard time


From: "Guillaume Dupuis" <[EMAIL PROTECTED]>
> Now, I am testing the interaction of 2+ servers working together. From
> SERVERA I create and echo the my SID using "echo session_start(); echo
> session_id();echo $SID;", and then I follow a link (within the same
browser
> session) to SERVERB and then do the exact same 3 calls.
>
> They give me different $SID ???

When you go from SERVERA to SERVERB, you do not carry over the same session
ID, though. SERVERB, not seeing a session id passed to it, starts it's own
session. You need to pass SID in the URL when linking to the different
servers. No way around this. The session id can be carried in the cookies
once you're operating on the same server, but when going from one server to
another, you must manually pass it.

<a href="http://SERVERB?<?=SID?>">SERVERB</a>

---John Holmes...

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to