auto login and sessions
Posted: Sun Feb 23, 2003 9:03 pm
hey guys
i am makeing a site for a client and he wants auto login, and i have all that part working and all.
if user is new to website then he gets logged in as guest, if the user has logged in before and chose to remain logged in then the script reads the cookie and gets the value and logs him/her in.
Problem:
Me and one other user get logged in as guest by the script, i get to see all the pages, he get "Server not found" error on "new_user.php" page but still sees all the other pages in the site.
so i was wondering why does that happen? and how to fix it?, btw the site is on my computer atm, so is that why i am able to see all the pages?
i am useing Apache 1.3.23, php 4.2.3 on windows XP.
i have't changed anything in php.ini, only email settings.
btw, how would i delete this cookie?
thanks alot for your time
- Qads -
i am makeing a site for a client and he wants auto login, and i have all that part working and all.
if user is new to website then he gets logged in as guest, if the user has logged in before and chose to remain logged in then the script reads the cookie and gets the value and logs him/her in.
Problem:
Me and one other user get logged in as guest by the script, i get to see all the pages, he get "Server not found" error on "new_user.php" page but still sees all the other pages in the site.
so i was wondering why does that happen? and how to fix it?, btw the site is on my computer atm, so is that why i am able to see all the pages?
i am useing Apache 1.3.23, php 4.2.3 on windows XP.
i have't changed anything in php.ini, only email settings.
btw, how would i delete this cookie?
Code: Select all
<?php
$time = time();
$random = mt_rand(0,$time);
$autologin_length = 60*60*24*30;
setcookie("autologin",$random, time() + $autologin_length);
?>- Qads -