Hi,
OK... honestly I'm trying to understand, please bear with me. All of the tutorials I've seen don't cover this type of stuff. The php manual is so vague...
I don't want to set someone's favorite colors, or fruits or something silly.
I am trying to start a session on Page1 - then what code do I need on Page2 to determine if the session was started on Page1, and the cookie was set on the users computer?
On page one I start a session with this code:
<?
session_start();
$cur_id = session_id();
echo "<html><head></head><body leftmargin=\"40\">Before pass you off to the PAGE 2 or 3 your session id is: " . $cur_id . "<br><br><br>";
echo "<a href=\"page2.php\">Click Here For Page 2</a><br></body></html>";
?>
Now on page 2, I want to be able to test if a session already exists? HOW? do I test if a session is already set?
I tried this code:
<?
$existing_sid = session_id();
echo "<html><head></head><body leftmargin=\"40\">This is the result of getting the session id if it exists, it is: " . $existing_sid . "<br><br><br>";
echo "<br></body></html>";
?>
I don't understand why it doesn't work, or how you can test if a session is set? I don't want to start a new session on page 2, I just need one is already set?
The php manual says to call session_id(); before calling session_start();
If I call to obtain a session id [B][U]after[/B][/U] session_start(), then there's [B][U]no way to tell[/B][/U] if it is the session id from the starting page or an id that was just created??
AHHHHHHHHH!!!!
Why is this so difficult!?!!?!?!
Why aren't there any tutorials that show how to test if a specific session exists??
Vmusic