Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-29-2008, 05:07 PM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default cookies on the field

I know there is Zend_Auth_Storage_Interface to keep your session saved but that means I should not use cookies anymore?

(and there is also Zend_Http_Cookie) (oh and Zend_Controller_Request_Http)
I remember a friend saying that the session lasts a lifetime, but you see right now i'm a bit confused.

Last edited by David : 02-29-2008 at 05:09 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-29-2008, 05:16 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

By default, sessions do not last a lifetime, but die when the user closes their browser. There is a time limit (usually about 20 minutes or so), so that if there are no new requests (user browses to another page, etc) the session will just time out.

Sessions will set a cookie, but only to keep track of the user and the session... there is a session file on the server that cooresponds to this cookie, and this is how their session is recognized by php on the next request.

You can override this in PHP.ini, including not using cookies (which will pass the session identifier as a query string variable)... but this is not recommended for security.

If you can avoid setting your own cookies, and store info in the session, then I recommend doing so. However, if you need information to last longer than the session, then cookies are a decent choice, but just use them sparingly.

And don't worry about using Zend_Http_Cookie and Zend_Controller_Request_Http or anything... Just call setcookie() as normal.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-29-2008, 05:39 PM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default

Quote:
Originally Posted by xentek View Post
If you can avoid setting your own cookies, and store info in the session, then I recommend doing so. However, if you need information to last longer than the session, then cookies are a decent choice, but just use them sparingly.
Well, I think it would be sort of impossible for a custom CMS, then again I'll read more about sessions (not technically used to them in any way) should be a good practice.

Thanks !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-29-2008, 08:19 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

What are you looking to store in the cookie?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-29-2008, 08:36 PM
Junior Member
 
Join Date: Feb 2008
Posts: 18
Default

Quote:
Originally Posted by xentek View Post
What are you looking to store in the cookie?
Right now, just a normal cookie to write in the user and pass and a session id *to tell the location where the user's in right now* to store for at least a year (expiration)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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



All times are GMT. The time now is 10:05 PM.