[SOLVED] Session trouble
Posted: Wed Jul 07, 2004 3:37 am
Bech100 | Please use
If the user is authenticated he is redirected to a index page with the following code:
For some reason this works fine Opera, but not in Mozilla In Mozilla the session is active when the user is authenticated because it prints isset, but when the user comes to the index page he is redirect back to the login page. Has anyone encountered this problem before? I am doing something wrong? If this is a commen problem is there a work around?
Bech100 | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I am having a trouble with sessions. The code works fine in Opera, but in Mozilla I get into trouble ( this might be a mozilla bug, but what do I know ).
I have a login in page as follows.Code: Select all
<?php
session_start();
$knownUser;
if( !empty($_POST[ 'username' ]) && !empty( $_POST[ 'password' ] ) ){
//athenticate
}
if( $knownUser ){
//redirect user to index page
if( isset( $_SESSION[ 'pageSession' ] ) ){
echo 'isset';
}
}else{
//create login page
}
?>Code: Select all
<?php
session_start();
$page;
//a session has not been created
if( !isset( $_SESSION[ 'pageSession' ] ) ){
//redirect back to login
}else{
//show page
}
?>Bech100 | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]