AFAIK the simplest form is modifying cake/libs/session.php, in

        function valid() {
                return $this->valid;
        }

The change must be.

        function valid() {
                return true;
        }

Another way is to check the __checkValid() function. In this, the time
validation is made under

                        if ($this->_userAgent == 
$this->read("Config.userAgent") && $this-
>time <= $this->read("Config.time")) {
                                $this->write("Config.time", $this->sessionTime);
                                $this->valid = true;
                        }

The first time, Cake set

                        $this->write("Config.time", $this->sessionTime);
Which is

                        $this->time = time();
                        $this->sessionTime = $this->time + 
(Security::inactiveMins() *
CAKE_SESSION_TIMEOUT);

You can bypass this restriction (I think), setting $this->time = 0.
With this, the if statement will ALWAYS set $this->value=true and
valid() will return true. Perhaps the second way is a more clever
because of the $this->_userAgent == $this->read("Config.userAgent")
check in the if. I'm not sure what's the real difference between both
modifications.

Anyway, I'm not sure if it's the best way to have an unexpired
session.

Saludos and please sorry for my poor english.


On 8 jun, 12:05, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi,
> I have a websitehttp://tvkalendar.comwhenever you click on a link
> (show name) it sets it to be a favorite.  It makes the favorites stick
> via sessions.  All works fine but if you come back to the site in a
> few hours the settings are wiped clean again.  I've messed around in
> core.php with the values but it doesn't seem to make a difference.  Is
> there any way to make a session last forever?  Or can anyone think of
> a better way to do this?
>
> Thanks,
> Matt


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to