|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Well, I've been developing a member system for my site however I have just struck a block. I would like to store a cookie in the client's browser so the first time he logs on he stays logs on forever until he logs off by clicking the log off button. So if he logged on today & visited a week later, he'd still be logged on.
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
|
#2
|
|||
|
|||
|
$name = "username";
$value = "my username"; $date = date("r",strtotime("+90 day")); $path = "/"; header("Set-Cookie: $name=$value; expires=$date; path=$path;"); this would expire in 90 days store a cookie variable as username and contain the variable my username its also accessable from any dir under the current one |
|
#3
|
|||
|
|||
|
I've tried the setcookie() function however I still cannot set a cookie...
PHP Code:
Any ideas? Edit: Ignore the <a> tag in the header(). vb is putting the code in by itself... Last edited by wAr-AnGeL : September 6th, 2002 at 11:54 AM. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Login /w cookies |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|