0

I'm using Zend Framework.

I want to do something similar to SO, when you are not a registered user, you keep your account as long as you remove all your cookies.

I know that session <> cookies, however what will be the best way to do that?

By the way, I'm using memcached because I plan to share sessions between frontend.

Is there any recommendations about this? because memcached data are volatile.

May I need to store them in a database instead?

Trent
  • 5,785
  • 6
  • 32
  • 43

1 Answers1

0

A possible solution could be calling Zend_Session::rememberMe() in each request, once you have checked that the user is authenticated.

Hope that helps,

dinopmi
  • 2,683
  • 19
  • 24
  • I tried that, whilst it extends the session experiration, it doesn't prevent the session to expire when the browser is closed, by the way what about memcached? – Trent Sep 25 '11 at 12:16
  • It works for me after closing the browser. Just in case... Did you call it after starting the session? According to Zend_Session documentation, it should be called before the session starts: http://framework.zend.com/manual/en/zend.session.global_session_management.html#zend.session.global_session_management.rememberme Sorry, I can't answer to the memcached part of your question, I don't use it. – dinopmi Sep 25 '11 at 17:08
  • Some additional suggestions can be found here: http://stackoverflow.com/questions/1489807/zend-framework-session-expires-prematurely . You might also need to set the PHP `session.gc_maxlifetime` parameter appropriately. – dinopmi Sep 26 '11 at 08:22