Page 1 of 1

Session Problems

Posted: Wed Feb 17, 2010 9:04 pm
by nblackwood
I have been trying to get sessions to work with no luck. Here's some code that i'm using for putting into session and session variable retrieval. If anyone can tell me what's wrong or what i didn't do. and yes I am putting session_start(); on each page but with no success. Thanks for any input.

<?php session_start();

$_SESSION["Name"];
$_SESSION["Email"];

?>

Variable Retrieval:

<?php echo $_SESSION["Name"];?>

Please Help.

Re: Session Problems

Posted: Wed Feb 17, 2010 9:18 pm
by clydoris
i got the same problem too..any help?

Re: Session Problems

Posted: Wed Feb 17, 2010 9:19 pm
by jthermane24
try using single quotes not double quotes

Re: Session Problems

Posted: Wed Feb 17, 2010 9:39 pm
by nblackwood
that made no difference

Re: Session Problems

Posted: Wed Feb 17, 2010 10:58 pm
by Weiry
Are you setting your session variables at all?

Code: Select all

<?php
session_start();
 
$_SESSION['name'] = 'MyName';
$_SESSION['email']   = 'MyEmail';
$_SESSION['time']     = time();
 
print_r($_SESSION);
?>

Re: Session Problems

Posted: Fri Feb 19, 2010 10:25 pm
by clydoris
oh, that's it..i think i've got it..