0

I am using this code and after first entry of new user to page comet cache will not send cached content.

$status = session_status();
if($status == PHP_SESSION_NONE){
    session_start();
}
if (isset($_SESSION['comparison']) && is_array($_SESSION['comparison']) && count($_SESSION['comparison'])>0){
            define('DONOTCACHEPAGE', TRUE);
    }
Cœur
  • 37,241
  • 25
  • 195
  • 267
Pavel Hájek
  • 176
  • 1
  • 8
  • I think you might need to refine your question to get good answers. Off topic: you do not need to check for session status before calling `session_start()` – edi Mar 28 '17 at 11:45
  • oh ... that might be the problem ... I think you always need to call `session_start()`. See that [stackoverflow post](http://stackoverflow.com/questions/5779744/php-session-start-function-why-i-need-it-everytime-i-use-anything-related-to) – edi Mar 28 '17 at 11:48
  • Yes, but I must to check if session is NOT start – Pavel Hájek Mar 28 '17 at 12:53
  • why? [PHP doc](http://at1.php.net/manual/en/function.session-start.php): "session_start() creates a session or **RESUMES the current one** based on a session identifier passed via a GET or POST request, or passed via a cookie." – edi Mar 28 '17 at 18:52
  • Comet cache working like I am logged but I am not logged in. When I reload page comet cache works perfectly. – Pavel Hájek Mar 29 '17 at 07:29

0 Answers0