Jump to content

cookies and date


krike

Recommended Posts

I have 2 questions

 

the main question I have is the following, I made a tutorial system and the user system is based on sessions.

I'm saving 4 things into sessions; id, unique_id, username & password

 

now I would like to use cookies so you don't have to login each time you visit the site, what information should I store into cookies ? the id or username and pass? which one is saver? :shrug:

 

 

my second questions: which method is best for date when storing it into a database? mysql timestamp or the php date() function?

Link to comment
https://forums.phpfreaks.com/topic/168791-cookies-and-date/
Share on other sites

someone allready helped me :D thanks anyway

 

if anyone is interested:

 

- for the cookies I store a md5 hash of the password and a unique_id (6 digits) generated when a user register. So should be good.

 

- and for the date I use the time function

 

$t=time()+60*60*24*7; //7 days = 1 week
echo $t . "<br />"; //output example 1249579107
echo date("Y-m-d",$t); //output example 2009-08-05

Link to comment
https://forums.phpfreaks.com/topic/168791-cookies-and-date/#findComment-892366
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.