Current location: Hot Scripts Forums » Programming Languages » PHP » Cookies or Sessions


Cookies or Sessions

Reply
  #1 (permalink)  
Old 10-29-06, 12:33 PM
_matt _matt is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Cookies or Sessions

I am making a login and was wondering what the general population is using. Cooies or Sessions. What are the benifits to each and disadvatages.
Reply With Quote
  #2 (permalink)  
Old 10-30-06, 12:23 PM
woyrz's Avatar
woyrz woyrz is offline
Newbie Coder
 
Join Date: Dec 2003
Location: montreal
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Depends what you want to do.



On my point of view i like to use session they are flexible and more secure.

why i would use session:
- they end as soon as the user close its browser
- More "secure" than a cookie
- you can modify the content at any time in your document
Why i would not use session:
- You have to use the star session on i the header of your document top be hable to use it.
- Its no essay to recover data from it if the user close it browser.

A mixt of both could be interesting. Its allow you keep track of you user if they come back. Most of the web site use both.

Woyrz
Reply With Quote
  #3 (permalink)  
Old 10-30-06, 02:15 PM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by woyrz
why i would use session:
- they end as soon as the user close its browser
Not always true, depending on the browser you use.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Reply With Quote
  #4 (permalink)  
Old 10-30-06, 02:23 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
session.cookie_lifetime determines how long the browser will/should keep the session cookie. However, the corresponding session (session file) will be deleted on the server when garbage collection occurs (even if the session is active at the time.)
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help alternative to cookies and asp sessions paulbarron ASP 3 08-21-06 09:44 AM
cookies or sessions? fraggle PHP 3 11-16-05 01:01 PM
Getting PHP to use cookies for sessions perleo PHP 1 10-24-04 07:56 PM
Sessions & Cookies rocky PHP 2 07-14-04 10:42 AM
how to get my sessions script work with cookies JM007 PHP 1 06-24-03 08:06 AM


All times are GMT -5. The time now is 05:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.