I have a site where users register and log in. All the data is stored
in a MySQL database.
When a user logs in, the username and password is checked in the
database and if all ok I set a few sessions. Then at the top of each
page I simply check that the sessions have been set and carry on.
All this works fine except for users on AOL. They log in but straight
away are told that they need to log in.
After many weeks of testing different things I'm still confused why it
doesn't work.
I created a some test scripts as follows to try and get sessions
working...
aolphpsetup.php
<?php
ini_set('sessio n.use_trans_sid ',1);
ini_set('sessio n.use_cookies', 0);
?>
aolinclude.php
<?php
if ($_SESSION[s_check1] == 4) {
$another_check = "1";
} else {
$another_check = "0";
}
?>
aoltest.php
<?php
include("aolphp setup.php");
session_start() ;
$_SESSION[s_check1] = "4";
?>
<body>
<form name="form1" method="post" action="aoltest 1.php">
<input type="submit" name="Submit" value="Click Me">
</form>
</div>
</body>
aoltest1.php
<?php
include("aolphp setup.php");
session_start() ;
header("Locatio n: aoltest3.php?". SID);
?>
aoltest3.php
<?php
include("aolphp setup.php");
session_start() ;
include("aolinc lude.php");
?>
<body>
$_SESSION[s_check1] = <?php echo $_SESSION[s_check1];?><br>
$another_check = <?php echo $another_check; ?>
</body>
When running aoltest.php you should click the button and the output
via aoltest3.php should produce as expected but it doesn't with an AOL
user.
I'm using PHP version 5.0.4 and below is the settings of the sessions
in my phpinfo..
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_st art Off Off
session.bug_com pat_42 Off Off
session.bug_com pat_warn On On
session.cache_e xpire 180 180
session.cache_l imiter nocache nocache
session.cookie_ domain no value no value
session.cookie_ lifetime 0 0
session.cookie_ path / /
session.cookie_ secure Off Off
session.entropy _file no value no value
session.entropy _length 0 0
session.gc_divi sor 1000 1000
session.gc_maxl ifetime 1440 1440
session.gc_prob ability 1 1
session.hash_bi ts_per_characte r 5 5
session.hash_fu nction 0 0
session.name PHPSESSID PHPSESSID
session.referer _check no value no value
session.save_ha ndler files files
session.save_pa th /tmp /tmp
session.seriali ze_handler php php
session.use_coo kies On On
session.use_onl y_cookies Off Off
session.use_tra ns_sid 0 0
Has anyone come across this problem and found a solution.
Many Thanks
Mike
in a MySQL database.
When a user logs in, the username and password is checked in the
database and if all ok I set a few sessions. Then at the top of each
page I simply check that the sessions have been set and carry on.
All this works fine except for users on AOL. They log in but straight
away are told that they need to log in.
After many weeks of testing different things I'm still confused why it
doesn't work.
I created a some test scripts as follows to try and get sessions
working...
aolphpsetup.php
<?php
ini_set('sessio n.use_trans_sid ',1);
ini_set('sessio n.use_cookies', 0);
?>
aolinclude.php
<?php
if ($_SESSION[s_check1] == 4) {
$another_check = "1";
} else {
$another_check = "0";
}
?>
aoltest.php
<?php
include("aolphp setup.php");
session_start() ;
$_SESSION[s_check1] = "4";
?>
<body>
<form name="form1" method="post" action="aoltest 1.php">
<input type="submit" name="Submit" value="Click Me">
</form>
</div>
</body>
aoltest1.php
<?php
include("aolphp setup.php");
session_start() ;
header("Locatio n: aoltest3.php?". SID);
?>
aoltest3.php
<?php
include("aolphp setup.php");
session_start() ;
include("aolinc lude.php");
?>
<body>
$_SESSION[s_check1] = <?php echo $_SESSION[s_check1];?><br>
$another_check = <?php echo $another_check; ?>
</body>
When running aoltest.php you should click the button and the output
via aoltest3.php should produce as expected but it doesn't with an AOL
user.
I'm using PHP version 5.0.4 and below is the settings of the sessions
in my phpinfo..
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_st art Off Off
session.bug_com pat_42 Off Off
session.bug_com pat_warn On On
session.cache_e xpire 180 180
session.cache_l imiter nocache nocache
session.cookie_ domain no value no value
session.cookie_ lifetime 0 0
session.cookie_ path / /
session.cookie_ secure Off Off
session.entropy _file no value no value
session.entropy _length 0 0
session.gc_divi sor 1000 1000
session.gc_maxl ifetime 1440 1440
session.gc_prob ability 1 1
session.hash_bi ts_per_characte r 5 5
session.hash_fu nction 0 0
session.name PHPSESSID PHPSESSID
session.referer _check no value no value
session.save_ha ndler files files
session.save_pa th /tmp /tmp
session.seriali ze_handler php php
session.use_coo kies On On
session.use_onl y_cookies Off Off
session.use_tra ns_sid 0 0
Has anyone come across this problem and found a solution.
Many Thanks
Mike
Comment