Jump to content

Cookies VS. Sessions


radar

Recommended Posts

Okay so I will eventually have 2 login systems on my site... 

The first one I am writing should expire in 3600 seconds from the time it was written or when the browser is closed -- whichever is first.... this is for the admin console...

Then the one for the members to log in..  Will be 1 of 2 choices...  When the browser closes it's gone..  or if they click Remember Me its for as long as I can make it...

So what would you say I should make these?  Cookies or Sessions..  and whichever one you think is better -- what would the basic syntax be to set the expiry time...  I thought it was something like

$expiry = time() + 3600;
setcookie("logged_in_admin", $username, $expiry);

or something like that..  and for sessions i have no clue...  Well let me know what yall think would be the best option and possibly what syntax I would use...
Link to comment
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.