Disable caching if session variable exists
-
Hello. I have some content that appears based on if a session variable has been set. For example, if they are a repeat viewer (have a session var stored) then a header strip appears. The problem is that hummingbird is caching the pages without the header strip.
I need it show the header strip if the session variable is set. I know you can do things with cookies and logged in status. but how to I get it to no cache pages if session var set?
Can I just put this into my header.php in the theme to dynamically set cache status for all pages?
<?php if(is_user_logged_in() || isset($_SESSION['repeat_viewer']) { define('DONOTCACHEPAGE', true); } ?>Thanks.
The topic ‘Disable caching if session variable exists’ is closed to new replies.