Jeremy Burns
On 1 Feb 2010, at 12:36, Lorenzo Bettini wrote:
the real problem is that beforeRender is not called if the page is present in the cache... any idea of where to put such control?
thanks in advance
Lorenzo
djogo wrote:Euromark, I think that __construct is the first thing that runs in Anyclass, so sessions are avaliable in all methods.I thought of using it at bootstrap, but there the session isunavailable...On 31 jan, 20:29, euromark <dereurom...@googlemail.com> wrote:this will never workthe session is initialized in __construct() of the app controllertherefore not available until beforeFilter() in any controllerthe session will not be present at that time yetor am i mistaken?On 31 Jan., 22:09, majna <majna...@gmail.com> wrote:> dirty way (not tested)in app/config/bootstrap.phpcheck if user is logged in, like:if (isset($_SESSION['User']['id])) {Configure::write('Cache.check', false);}On Jan 31, 11:32 am, Lorenzo Bettini <bett...@dsi.unifi.it> wrote:Hiin my AppController I've enabled cache for view and index actions andthey work fine.Now, I'd like to disable cache when a user is logged, since in that caseadditional information are shown that must not be cached.Thus I added the methodfunction beforeRender() {if ($this->is_logged_user()) {// disable cache when the user is logged, since some information// must NOT be cached, e.g., private papers$this->cacheAction = array();}}where is_logged_user is a function that checks whether a user is logged.This works in the sense that no cache is used when a user is browsingthe site. However, if the user visits an action page which has alreadybeen cached then he will get the cached page, which I want to avoid aswell... is there a way to avoid this?I've also tried with $this->disableCache() but that does not work.The only solution I see is to clear the cache, but I'd want to avoid that...thanks in advanceLorenzo--
--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment