Re: Understanding sessions

From: Date: Fri, 09 Apr 2004 17:49:37 +0000
Subject: Re: Understanding sessions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-183017@lists.php.net to get a copy of this message
If I use session_id(), I do get a value. However, I have session_use_cookies = 0 and I do not have a value for SID. Is that correct? Todd Daniel Clark wrote:
Todd, I think you want the session_id() function. http://us3.php.net/manual/en/function.session-id.php
I am trying to understand sessions are done with php. My "learning script" has the following: session_start(); if (isset($_SESSION['firstname'])) {
    $_SESSION['firstname'] = 'Todd';
} else {
    $_SESSION['firstname'] = 'Nobody';
} echo "SESSION: " . $_SESSION['firstname'] . "<br>"; echo 'SID: ' . SID . '<br>'; echo '<br /><a href="page_2.php?' . SID . '">page 2</a>'; SID is always empty. What have I missed? Todd


« previous php.general (#183017) next »