Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:lscwp:troubleshooting:php_session_and_cache [2018/06/24 16:15]
qtwrk
litespeed_wiki:cache:lscwp:troubleshooting:php_session_and_cache [2020/05/04 13:51]
Shivam Saluja
Line 1: Line 1:
-====== ​Page depends ​on PHP session doesn'​t work with LiteSpeed Cache ======+====== ​Caching Pages That Depend ​on PHP Session ​====== 
 +**Please Note**: This wiki is valid for v2.9.x and below of the LiteSpeed Cache Plugin for WordPress. If you are using v3.0 or above, please see [[https://​docs.litespeedtech.com/​lscache/​lscwp/​overview/​|the new documentation]].
  
-===== Symptom and behavior: =====+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, code change ​to the third party plugin is required. The developer can change the plugin to store the value in cookie and then LiteSpeed Cache can be set to [[litespeed_wiki:​cache:​developer_guide:​cache-vary|vary on that cookie]].
  
  
  
  • Admin
  • Last modified: 2020/11/14 15:43
  • by Lisa Clarke