1. how to set a session with a long life cycle? Set sessioncookie_lifetime and sessiongc_maxlifetime to a longer time. 2. why initialize the session
1. how to set a session with a long life cycle?
Set the time of session. cookie_lifetime and session. gc_maxlifetime to a little longer.
2. Why is an error reported during session initialization?
A. Check the storage path, path, and Operation permission of the session file.
B. check whether html content is output before session initialization.
3. Does session affect the client's use of cookies?
When the client's cookie is rejected. This will cause a lot of inconvenience:
Php automatically adds the sessionId parameter to links and forms on the page. To ensure the session continues, but at this time, manually enter the same address multiple times in a browser, the session will be considered as multiple sessions instead of once.
4. Why does my session expire in a few minutes?
1. check whether the cookie of the browser is enabled. if not, check whether the system promises to use the url to pass the sessionID. Finally, check the url_rewriter.tags settings.
2. check the spam identification time and recovery probability of the session.
5. how can I store my sessions in the database?
Use session_set_save_handler ("open", "close", "read", "write", "destroy", "gc") to customize the processing method.
6. how can I use the session to get the current number and list of users?
If the session is stored in the database, it is easy to implement, but no matter what method is used to obtain the data, it is not necessarily accurate data.
7. Why does the content disappear after I enter the form?
Check whether the script initializes the session. If yes, use:
Session_cache_limiter ('private, must-revalidate ');
6. how can I use session to control the webpage cache?
Adjust session. cache_limiter, session. cache_expire
8. I use session to manage sessions. Will it be affected if the same account is logged on to both machines at the same time?
It will not be affected. Because this is two sessionids, that is to say, the server has two session files to ensure their respective sessions.