I'm trying to make a login-system for my website using sessions.
But I don't get it working! Argh!
This is what I'm doing:
On login.php is a log-in form whith <form ... action='page1.php'>.
On page1.php there is a script that checks whether the username and password are known in the database. If so, username and id will be registered session variables (using $_SESSION['username']). User will be linked to a page2.php.
On page2.php I want to check for the session variables.
This is what happens:
Everything works, until I'm at page2.php. Yhere my session variables are gone! I can't echo them, and when I do a isset($_SESSION['username'], it is NOT set. But I DID set it on page1.php!
There is something strange besides that. When I use session_start() on page2.php my session file in /tmp become empty 0(k! when I don't use session_start(), they're 34(k
containing 'username' and 'id', but still won't show up on page2.php with an echo.
Can anyone help me please! I really need that log-in system, and I definitely will need sessions in the future.
Thanx allready
P.S.
My system:
Linux Debian 3.0 (woody)
Apache 1.3.26
PHP 4.2.1 (from Debian sid release(unstable))