If the session hasn't been set it is invalid. You can see this on the
cake/libs/controller/components/session.php constructor. If you don't have
AUTO_SESSION defined the session will be inactive (until you build it):
function __construct($base = null) {
if (!defined('AUTO_SESSION') || AUTO_SESSION === true) {
parent::__construct($base);
} else {
$this->__active = false;
}
}
So then you go to the valid() method and see:
function valid() {
if ($this->__active === true) {
return $this->isValid();
}
return false;
}
And the isValid() method comes from cake/libs/session.php:
function isValid() {
return $this->valid;
}
If you want to learn further about what Cake considers as a valid session,
on that file look over the function __checkValid(). You will see how it
prevents session hijacking.
Upgrading: there's a release note on the bakery for 1.1.11.4064 that will
tell you things you need to know when doing 1.1.10 -> 1.1.12 update:
http://bakery.cakephp.org/articles/view/174
Main thing you need to make sure before upgrading is to change (if you do
any) the way you MANUALLY load models. That is, if for some reason you have
something like this on your controllers:
$myModel = new Model();
You need to change it to:
loadModel('Model');
$myModel = new Model()
Because since 1.1.11 models are lazy-loaded.
Other than that I have not encountered any problems when I upgraded. So make
sure you read that article and the changelog:
https://trac.cakephp.org/wiki/changelog/1.1.x.x
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
blog: http://www.MarianoIglesias.com.ar
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de bobmaluga
Enviado el: Domingo, 04 de Febrero de 2007 06:47 p.m.
Para: Cake PHP
Asunto: Re: how to check for session expire
however, if the session has not yet been set, will $this->Session-
>invalid() return true?
Actually I have 1.1.10 on production. will upgrading to 1.1.12 break
anything?
Anyway, i have plan for upgrading. Just to do it so carefully.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---