Solved

"permanent" cookies

Posted on 2002-03-31
3
281 Views
Last Modified: 2012-06-27
Hi There,
how can I write a file into the cookie directory of the client?
So if the user is logged in once, that just need to look for the cookie, if the user wants to log in again.
Is that possible with setcookie?
thx Randal
0
Comment
Question by:Randal_Flagg
  • 2
3 Comments
 
LVL 4

Expert Comment

by:lokeshv
ID: 6908746
You need to set an expiration date for your cookie so that it doesn't end at the end of the browser session. Using the setcookie() function in PHP you can set it up like so:

setcookie('cookiename','cookievalue',(time()+2592000),'/','',0);

This cookie would expire in one month. You just need to change the time to whenever you want it to expire. You can also replace (time()+2592000) to "-1" and this should set the cookie to never expire if you don't want them to ever be able to vote again.



hope this wil help

Lk
0
 
LVL 4

Accepted Solution

by:
lokeshv earned 50 total points
ID: 6908749
0
 

Author Comment

by:Randal_Flagg
ID: 6923640
Sorry for answering so late...
Mailserver was crashed and down..
Randal
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question