$_SESSION problem !

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

Post Reply
Perfidus
Forum Contributor
Posts: 114
Joined: Sun Nov 02, 2003 9:54 pm

$_SESSION problem !

Post 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?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post 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 ?
Post Reply