Page 1 of 1

$_SESSION problem !

Posted: Sat Jul 23, 2005 4:42 pm
by Perfidus
I have a password validation page that redirects user who introduced right pass and user to another page with the following code on top:

Code: Select all

<?php 
//page2 
session_start(); 
if (session_is_registered('user')){ 
if(!isset($_SESSION['langfixed'])){ 
$_SESSION['lang']='en';} 
} 
else{ 
header("Location: entry.php?baduser=1");
}


Validation works nice, but if I echo $_SESSION['lang'], it will only appear when page is loaded for the first time, if I refresh the page $_SESSION['lang'] disappears.
Why it doesn't remain?

Posted: Sun Jul 24, 2005 6:07 am
by anjanesh
Are you having the session ids stored in the form of cookies or in the url ($_GET) ?

Whats the Timeout value for your sessions ?