Session loggin me out

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Session loggin me out

Post by pinehead18 »

How come when i am on a page whenever i hit refersh it logs me out of my session? The page with the session looks like this


session_start();
header("Cache-control: private");
$name = $_SESSION['name'];
if(!isset($_SESSION['name'])) { header("Location: /loginbox.php"); exit; }


It lets me in, however if i hit refersh it logs me out.

Thank you
Anthony
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Locked