Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:cache:lscwp:troubleshooting:php_session_and_cache [2018/06/24 16:14] qtwrk created |
litespeed_wiki:cache:lscwp:troubleshooting:php_session_and_cache [2018/06/25 15:22] Lisa Clarke Proofreading |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Symptom and behavior: ===== | + | ====== Caching Pages That Depend on PHP Session ====== |
+ | If you have pages that depend on the PHP Session, you will find that they don't work properly with LiteSpeed Cache. | ||
- | Some plugin as WHMpress that uses PHP session to store values (currency, language...etc), the selection doesn't work with LiteSpeed Cache. | + | ===== Symptom and Behavior ===== |
- | Once enabled LiteSpeed Cache, user depended value like currency will not work or display correctly. | + | Some plugins such as WHMpress that use PHP session to store values (currency, language...etc) don't work with LiteSpeed Cache. |
- | ===== Cause: ===== | + | Once LiteSpeed Cache is enabled, user dependant values like currency do not work or display correctly. |
- | A page content depends on PHP session is not cache-friendly, once cached page is generated , it will not vary on session data. | + | ===== Cause ===== |
- | As LiteSpeed Cache is designed to avoid hit PHP backend, therefore there is no way for cache module to know what value it is stored in PHP session. | + | Pages whose content depends on PHP session are not cache-friendly. Once the cached page is generated, it will //not// vary on session data. |
+ | |||
+ | Why? LiteSpeed Cache is designed to avoid hitting the PHP backend. Therefore, there is no way for the cache module to know what value is stored in PHP session for any visitor other than the first one to load the page. | ||
===== Solution: ===== | ===== Solution: ===== | ||
- | To make this to work , it will require code change in plugin to make it store values in cookie and set LiteSpeed Cache to [[litespeed_wiki:cache:developer_guide:cache-vary|vary on cookie]]. | + | To make this to work, a code change to the third party plugin is required. The developer can change the plugin to store the value in a cookie and then LiteSpeed Cache can be set to [[litespeed_wiki:cache:developer_guide:cache-vary|vary on that cookie]]. |