Timeout-dialog is a JQuery plugin that displays a timeout popover after a certain period of time. The timeout dialog should be used whenever you want to display to the user that the logged in session is about to expire. It creates a light box with a countdown and options to stay signed in or sign out.
Yii 1.1.x, jQuery.ui core script
In your layout view:
$this->widget('ext.timeout-dialog.ETimeoutDialog', array( // Get timeout settings from session settings. 'timeout' => Yii::app()->getSession()->getTimeout(), // Uncomment to test. // Dialog should appear 20 sec after page load. //'timeout' => 80, 'keep_alive_url' => $this->createUrl('/site/keepalive'), 'logout_redirect_url' => $this->createUrl('/site/logout'), ));
In your SiteController:
/** * Keep the session alive, called by timeout-dialog. */ public function actionKeepAlive() { echo 'OK'; Yii::app()->end(); }
timeout-dialog.js was developed by rigoneri.
Total 2 comments
Nice extension.
Could you help me on link this with yii built in session expired?
what should I put in here ???
<?php $this->widget('ext.timeout-dialog.ETimeoutDialog', array( 'timeout' => ???, 'keep_alive_url' => $this->createUrl('/site/keepalive'), 'logout_redirect_url' => $this->createUrl('/site/logout'), )); ?>Cheers
thanks very much for sharing! =))
Leave a comment
Please login to leave your comment.