Difference between #2 and #3 of
Using loginRequiredAjaxResponse to solve ajax session timeout

Revision #3 has been created by Rutger on Jan 4, 2017, 5:46:56 PM with the memo:

Fixed jQuery(document).ajaxComplete, thx to @myvay
« previous (#2)

Changes

Title unchanged

Using loginRequiredAjaxResponse to solve ajax session timeout

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

loginRequiredAjaxResponse, session, login, AJAX

Content changed

[...]
```php
<?php
if (Yii::app()->components['user']->loginRequiredAjaxResponse){
Yii::app()->clientScript->registerScript('ajaxLoginRequired', '
jQuery(
"body"document).ajaxComplete(
function(event, request, options) {
if (request.responseText == "'.Yii::app()->components['user']->loginRequiredAjaxResponse.'") {
window.location.href = options.url;
}
}
[...]
12 0
16 followers
Viewed: 37 462 times
Version: 1.1
Category: How-tos
Written by: Rutger
Last updated by: Rutger
Created on: Apr 11, 2012
Last updated: 7 years ago
Update Article

Revisions

View all history