Differences

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

Link to this comparison view

Both sides previous revision Previous 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 [2018/06/25 15:22] (current)
Lisa Clarke Proofreading
Line 1: Line 1:
-====== ​Page depends ​on PHP session doesn'​t work with LiteSpeed Cache ======+====== ​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.
  
-===== Symptom and behavior: ​=====+===== Symptom and Behavior ​=====
  
-Some plugin ​as WHMpress that uses PHP session to store values (currency, language...etc), the selection doesn't work with LiteSpeed Cache.+Some plugins such as WHMpress that use PHP session to store values (currency, language...etc) ​don't work with LiteSpeed Cache.
  
-Once enabled ​LiteSpeed Cache, user depended value like currency ​will not work or display correctly.+Once LiteSpeed Cache is enabled, user dependant values ​like currency ​do not work or display correctly.
  
-===== Cause=====+===== Cause =====
  
-A page content depends on PHP session ​is not cache-friendly, once cached page is generated , it will not vary on session data.+Pages whose content depends on PHP session ​are not cache-friendly. Once the cached page is generated, it will //not// vary on session data.
  
-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.+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: 2018/06/25 15:22
  • by Lisa Clarke