the problem. It is just a little "gotcha" with the way Cake loads
start_session(), or so it seems.
I've reproduced the bug with a clean copy of Cake 1.3.6. The reason
why the Session helper fails is only if you have browser output (like
debug output) in the beforeFilter() function of AppController or
anywhere sooner in the dispatching process.
To test, just type some pr() statement in
AppController::beforeFilter(), and then try to reproduce my original
problem above, and you'll see that the Session helper fails. BUT, if
you put something like $this->Session->check('blah') (even if 'blah'
is a nonexistent session key) BEFORE your pr() statement in
beforeFilter(), then the Session helper succeeds.
I believe the reason is because session_start() is not called early
enough in the application, but seems to be called on the first
instance of using the Session component (or helper), and if headers
have already been sent to the browser, session_start() fails. (Though
it is failing silently with my PHP error reporting set to ALL.)
Yuck! I'm glad I solved it though. I've reported issue in Lighthouse.
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