Jump to content
Old threads will finally start getting archived ×

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.