Hi PHP gurus,
I am a PHP newbie and have the following problem.
I wrote a simple php-script for a user login.
Everything works fine with IE and NS-Browsers. When I try the Login with Opera 6.05, I always need 2 attempts for the login and can not figure out whats going wrong.
I am using: Win2K, Apache 1.3.27 / PHP 4.3.0 (ApacheModule).
Here is my code:
Simple login form:
<form action="login.php" method="POST">
Username<input type="text" size="20" name="postUsername">
Password<input type="password" size="20" name="postPassword">
<input type=image src="submit.gif">
</form>
login.php
.. check the user and password data ...
if the logindata is correct, the variable status will be set to TRUE
if ( $status == 1 )
{
session_start();
$SESSION['sessionUser'] = $POST['postUsername'];
$_SESSION['sessionValid'] = 4711;
header("Location: /start.php");
}
start.php
In this file i try to check the session variables, and here is the problem with OPERA
session_start();
if ( !isset ($SESSION['sessionValid']) ||
!isset ($SESSION['sessionUser']) ||
( $_SESSION['sessionValid'] != 4711) )
{
session_destroy();
header("Location: /loginerror.php?errMsg=5");
exit();
}
else { login OK, do something useful ... }
Here is my php.ini (Part session)
session.save_handler = files
session.save_path = C:/Programme/Apache Group/php/session_data
session.use_cookies = 1
; session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
...
I wonder, if using IE or NS there is no file in the session.save_path - dir.
When using OPERA the following file is created:
sess_288fc55fb801d6b3f36c14af45db635e
whith the content:
sessionUser|s:4:"Hans";sessionValid|i:4711;
sorry about my poor English and the amount of text ...
Any ideas ?
WebMatz