I have an internet forum and I need to implement a permanent login. I mean that the login name should be held on the client computer and probably I should check this file during session start. Right now my login works fine, I use PHP sessions, but of course after closing the internet browser and opening it again, the user is logged off. What functions or libraries should I use to set a permanent cookie on the client comp. and then be able to get the information from it? The setcookie() function is only for temporary browser cookies, right? Well if I'm saying some bullshit please tell me so ;P I'm a little stuck though and I need your help.
Well maybe I should save the session ID on the client side as a cookie? But how to set this cookie as a file, not a temporary one?
read the manual on setcookie with PHP
Well this is the first thing I did. But there is nothing about permanent cookies there. When I create a cookie using set_cookie() it disappers while I close the browser window.
That's what I'm asking there - how to make them permanent.
did you set a time limit
oops 😉) well i haven't now it works. i mean i still see the cookie after re-opening browser but isn't there any other option? what if i want to set a cookie for infinite time? do i have to set it to a very very large value instead? i don't see it in the manual , but maybe i'm blind again ;P thanks anyway, for the tip
umm.. im not exactly sure..i dont think you can.. try your time limit in mktime. and set it that way..
like mktime(0,0,0,12,31,2500); or something.. i was just making that up.. i dont think the web will be around in 5ooyrs time anyway.
hehe well, probably it won't and even if it will, nobody will be using PHP version 4.2 anymore 😉))
ok. the logging works fine now. thanks again and see you later