Forum Moderators: coopster

Message Too Old, No Replies

Session Handling

         

lisa_alias

5:08 am on Mar 1, 2004 (gmt 0)

10+ Year Member



hi everyone!

i have some problems regarding session in PHP.

the problem :

1. why is the variable 'PHPSESSID' not working?
- it works for the first time only. contains nothing for the next next times..

2. when we set

<?
session_start();
$_SESSION['a'] = $_POST['a'];
$a1 = $_SESSION['a'];
?>

in page #1, when proceed to page #2, '$a1' contains no value. why is that?

yes, i have used 'session_start()' on the top of the pages. should i use 'session_id()' as well?

anyone has any comments?

thx..

jonknee

6:03 am on Mar 1, 2004 (gmt 0)

10+ Year Member



Because you have to call it as a session variable.. e.g, put:


$a1 = $_SESSION['a'];

On each page that uses $a1. This is a security thing I believe.