简体   繁体   中英

Zend framework Remember Me function

I want to use Zend framework's remeberMe() function to create a persistent log in experience for users. Here is what I know about Sessions:

1- When a user signs in to a website a session is created for him on the server on the file system .

2- a session cookie is generated on the client side holding an identifier for the session.

3- If a user closes the browser the session cookie is deleted while the session on the server will last until the garbage collector deletes the session's file (after a time set by gc_maxlifetime).

4- If a user leaves the browser open for a long time (longer than gc_maxlifetime) the garbage collector will delete the session's file while the session cookie will last till it's deleted when the browser is closed.

Now what does Zend framework's rememberMe() function do exactly?

a- Does it create a session cookie in the browser that lasts for the time specified in the call to it?

b- Does it increase the life time of the session file stored on the server so that the garbage collector doesn't delete the file?

c- If it doesn't affect the session file on the server then what happens when the session expires on the server side, but the session cookie is still available? will it be deleted on the spot or lift until it expires automatically?

Thanks in advance.

http://framework.zend.com/manual/en/zend.session.global_session_management.html "Use Zend_Session::rememberMe() before a session is started to control the length of time before a persisted session cookie expires."

It sets the cookie to live beyond the browser exiting, and sets its expiration time. Note that this is what all sites that "remember" the user's login do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM