Re: Understanding sessions

From: Date: Fri, 09 Apr 2004 17:55:41 +0000
Subject: Re: Understanding sessions
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-183018@lists.php.net to get a copy of this message
Daniel - As suggested, if I turn off cookies in my browser, then SID is set. So the directive in php.ini does not cause the use of cookies to be completely turned off? Another question envolves the use of the back button. My client wants the use of the back button to be turned off for security reasons for some pages. His preference is to have a page expire if it is arrived on by pressing the back button. Can this be done with sessions? Again, many thanks for your help as I go through the learning curve. In the past, I used my DB for storing sessions. 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 (#183018) next »