#6406: session helper not working with cached views --------------------------------+------------------------------------------- Reporter: zaptree | Type: Bug Status: new | Priority: Medium Milestone: 1.2.x.x | Component: General Version: 1.2 Final | Severity: Normal Keywords: session caching | Php_version: PHP 5 Cake_version: 1.2.3.8166 | --------------------------------+------------------------------------------- so i have some views that are cached and a login system on my website. In the cached views i have the following:
{{{ <cake:nocache> <?php if($session->check('Auth.User')){ echo 'Logged In'; }else{ echo 'not logged in'; { ?> </cake:nocache> }}} to test if this worked correct i set the session.timeout to 1 and security.level to high so that the session expires in 10sec. After login in if i wait more than 10 seconds and going to a non cached page that has the same code as above it will show "not logged in" as it should since the 10sec have passed and im no longer logged in. If i do the same thing but go to a cached page though it will show "logged in" even though im not since the 10 seconds have passed. If I log in and wait ten seconds then go to a non cached page and then to a cached page it will show "not logged in". So obviously the session helper when used in a cached page (in a nocahce block ofcourse) it will actually have the values of the last non-cached page visited or requestAction used. I was able to solve my problem after adding a requestAction in my layout for my shopping cart but then what if i didnt have that requestAction that refreshed the values of the session helper? -- Ticket URL: <https://trac.cakephp.org/ticket/6406> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---