Web Hosting Talk







View Full Version : session


orbitz
06-14-2006, 11:48 PM
I was creating a user session when he/she logged in.

I am giving a simple example below:

$_SESSION['username'] = $_POST['username'];

why would I able to echo the username when I go to another by just using?

echo $username; // or echo $_SESSION['username'];

sngskunk
06-15-2006, 12:05 AM
you shouldnt be able to unles in the next script you type


$username = $_SESSION['username'];


then you could recall the username!

orbitz
06-15-2006, 07:42 AM
Thanks, but that was not the problem.
The problem was that the server I was testing on had register global on.

I just flag it off using .htaccess php_flag register_globals off

and it solved the problem.

sngskunk
06-15-2006, 01:57 PM
OO okay weell im glad that you figured it out!