Sessions are automatically "renewed" when a request is performed. Two
options are:
1. Increasing the Session.timeout setting in core.php to something
massive
2. Use a small javascript to "ping" the server every so often to keep
the connection alive.
eg.
<script type="text/javascript">
// ping server every 5 minutes
new Ajax.PeriodicalUpdater('', '/ping', {method: 'get', frequency:
300} );
</script>
<?php
class PingController extends AppController {
function index(){
die('1');
}
}
?>
On Apr 2, 9:36 am, chewie124 <[EMAIL PROTECTED]> wrote:
> I want to maintain the session & the items I store in it longer than
> the predefined timeout in core.php. Would this work, if I put it in a
> beforeFilter?
>
> function beforeFilter() {
>
> if (!$this->Session->valid()) {
> $this->Session->renew();
> }
>
> }
>
> or is there another way to maintain session till the user closes their
> browser? (without having to persist the data in a cookie or in the
> database?)
>
> TIA!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---