note 16366 added to ref.session
| From: | bustydusty at caramail dot com | Date: | Fri, 26 Oct 2001 13:12:02 +0000 |
| Subject: | note 16366 added to ref.session | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19470@lists.php.net to get a copy of this message | ||
Hi everyone,
i have read a lot concerning php4 sessions (without cookies) and it seems to be clear to me now, but
i missed a point :
i have a login page (user_id and password)
session_start();
session_register("password");
session_register("user_id");
then my SQL query to check if the input are correct then redirection to the page if authenfication
is ok.
then to secure my second page, i start with
<?
session_start();
//i check in the session if user_id and password aare stored
if ($user_id && $ $password)
{
put my page code here
}
else
{
redirection to login page
}
after reading all the notes on this site it seems that session_start() has to be mentionned to check
if the vars stored are ok. But when i look to my temp folder where are stored the temporary files of
session, i see session files empty with session_files with my vars.
What about this ?
If on each page to protect i have to put the line session_start(), i will have lots of empty
sessions files near the correct session file.
Is there a another solution ?
thanks for yor contribution
--
http://www.php.net/manual/en/ref.session.php
http://master.php.net/manage/user-notes.php?action=edit+16366
http://master.php.net/manage/user-notes.php?action=delete+16366
http://master.php.net/manage/user-notes.php?action=reject+16366