#6406: session helper not working with cached views
    Reporter:  zaptree          |         Owner:           
        Type:  Bug              |        Status:  reopened 
    Priority:  Medium           |     Milestone:  1.2.x.x  
   Component:  General          |       Version:  1.2 Final
    Severity:  Normal           |    Resolution:           
    Keywords:  session caching  |   Php_version:  PHP 5    
Cake_version:       |  
Changes (by zaptree):

  * status:  closed => reopened
  * resolution:  needmoreinfo =>


 Sorry for the late reply, yes i checked that the code is php. I believe
 the problem has something to do with the var sessionTime in the session
 class. The session component sets it because in the __construct($base =
 null, $start = true) its set to true where as the session helper has start
 set to false so the var sessionTime is not set. So it seems that the
 session helper is not using our defined session expiration time but php's
 standard session expiration? im not really sure.

 Also I noticed another wierd behaviour. I have a requestAction that
 basically calls a page that gets the logged in users data if he is logged
 in otherwise sends back false so that i can show a login form. When i use
 the requestAction in my view before calling (i have it nocache block and
 the php code is in cached views in tmp):

         echo 'Logged In';
         echo 'not logged in';

 then it works fine and shows me that im not logged in when im not and then
 the following session helper works correctly also. But if i have the
 requestAction after the session helper being used then they both dont
 work. So i guess that probably one instance of the session object is
 created or something and if the session helper creates it first its got
 the wrong expiration time and then even the session component will get it
 wrong?? Well i hope this info helps. I fixed my app by making sure that
 the loginbox code is first (had to float right the divs since it was
 supposed to be on the right) but on other circumstances i might not want
 to have to use requestAction if not necessary because it slows down the

Ticket URL: <https://trac.cakephp.org/ticket/6406#comment:3>
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 
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 
For more options, visit this group at 

Reply via email to