Jump to content


Photo

Cookies VS. Sessions


  • Please log in to reply
2 replies to this topic

#1 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 27 August 2006 - 07:52 PM

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

#2 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 27 August 2006 - 08:29 PM

Have a look at this tutorial...there's a bit on login and using sessions which should help

http://www.phpfreaks...orials/40/0.php
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still

#3 radar

radar
  • Members
  • PipPipPip
  • Advanced Member
  • 645 posts
  • LocationSLC

Posted 27 August 2006 - 09:17 PM

AdRock -- this tutorial only stresses how to use session which is really easy...  It doesn't go into how if there is way to set the expiry of a session or anything that my post has questioned....




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users