Page 2 of 3
Posted: Fri 7. Nov 2003, 09:23
by Oliver Georgi
try this first:
create a new file "sessiontest.php" and put it on your webserver. Quit your browser.
Put this code into the "sessiontest.php":
Code: Select all
<?php
session_start();
if(isset($_GET["do"])) {
$_SESSION["test"]++;
header("Location: ".$_SERVER['PHP_SELF']);
}
?>
<html>
<head>
<title>Session Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Click for <a href="sessiontest.php?do=<?php echo intval($_SESSION["test"]) ?>">loading</a> session test!
<?php echo (isset($_SESSION["test"])) ? "<br><br>session var is set (".$_SESSION["test"].")" : "no session set"; ?>
</body>
</html>
It should count up 1 every time you click the link.
Oliver
Posted: Fri 7. Nov 2003, 09:25
by Oliver Georgi
User check is neccessary in the hole script. NEVER DISABLE THIS!!! This won't help you.
Oliver
Posted: Fri 7. Nov 2003, 09:28
by (Murphy)
The session test works fine...
Posted: Fri 7. Nov 2003, 09:36
by Oliver Georgi
try to insert the following code in your login.php - beste place is at line 193:
Code: Select all
<?php echo "USER-ID: ".$_SESSION["wcs_user_id"] ?>
First time this should be set to nothing - after successful login this should be your user-ID.
Oliver
Posted: Fri 7. Nov 2003, 09:41
by (Murphy)
It does not show any ID after trying to log in...
(thx for this real time support, btw
)
Posted: Fri 7. Nov 2003, 09:44
by Oliver Georgi
Yeah, that is the problem. It does not register the neccessary session vars.
But why?
Posted: Fri 7. Nov 2003, 09:49
by (Murphy)
If I was a real experienced php-programmer I would have a clue... But I am not, so I don't have one... sorry
Posted: Fri 7. Nov 2003, 09:51
by Oliver Georgi
Here my next try for you:
Extend differences beginning at line 71 of login.php:
Code: Select all
if($login_passed) {
// workaround for possible session register problems???
$_SESSION["wcs_user"] = $wcs_user;
$_SESSION["wcs_pass"] = $wcs_pass;
$_SESSION["wcs_user_name"] = $wcs_user_name;
$_SESSION["wcs_user_id"] = $wcs_user_id;
$_SESSION["wcs_user_aktiv"] = $wcs_user_aktiv;
$_SESSION["wcs_user_rechte"] = $wcs_user_rechte;
$_SESSION["wcs_user_email"] = $wcs_user_email;
$_SESSION["wcs_user_avatar"] = $wcs_user_avatar;
$_SESSION["wcs_user_logtime"] = $wcs_user_logtime;
$_SESSION["wcs_user_admin"] = $wcs_user_admin;
$_SESSION["wcs_user_thumb"] = $wcs_user_thumb;
/*
session_register( "wcs_user", "wcs_pass", "wcs_user_name", "wcs_user_id",
"wcs_user_aktiv", "wcs_user_rechte", "wcs_user_email",
"wcs_user_avatar", "wcs_user_logtime", "wcs_user_admin", "wcs_user_thumb");
*/
//Schreiben der Login-Daten in Datenbank
Oliver
Posted: Fri 7. Nov 2003, 09:51
by (Murphy)
What I do not understand:
As the system does not log me in, I am not forwarded to phpwcms.php - it is logical that far...
BUT!
Why does login.php show the user "webmaster" as being online?!
Posted: Fri 7. Nov 2003, 09:54
by (Murphy)
STRRRRRRRRRIKE!
It works!
Thank you
Posted: Fri 7. Nov 2003, 09:55
by Oliver Georgi
This is initially set in login.php on first load.
Posted: Fri 7. Nov 2003, 10:08
by itsu
Wow It worked now!!
thanks.
Posted: Sun 9. Nov 2003, 23:15
by moe
still cant login
php4.3.4 installed
session creation works
modified login.php as shown
I login as webmaster with password "pass"
user webmaster online but redirects me to login.php
I try to login again -----> script shows "Errors during login!"
wtf?
Posted: Sun 9. Nov 2003, 23:22
by Oliver Georgi
Please check everything again!
It have to work (i hope
) - I have tested the login process on more than 20 machines and 8 different PHP versions (4.2.1, 4.2.2, 4.2.3, 4.3.0, 4.3.1, 4.3.2, 4.3.3, 4.3.4) and 4 platforms (2000/XP/Suse7.3/8.1/RedHat 7.3/MacOSX)
The login form is case sensitive.
Oliver
Posted: Mon 10. Nov 2003, 13:36
by moe
nope....sorry...it doesnt work for me.
I tried it again, and now I even cant login, i.e "Errors during login!" and no user is shown as "online"
damn