Common Session problems in PHP. 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 1. how do I set a long-lived session?
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 guarantee the session
Continue, but at this time, manually enter the same address, session
It is considered as a multi-session instead of a single session.
4. Why does my session expire in a few minutes?
1. check whether the browser's cookie is enabled. if not, check
Does the system promise 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 ")
Customize your own 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 can be easily implemented, but no matter what
The obtained data 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, the server has two session files.
To ensure their sessions.
Why? 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...