Yii Framework Forum: Accessrules() And Ajax - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Accessrules() And Ajax

#1 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 752
  • Joined: 02-February 09

Posted 14 June 2013 - 07:32 AM

I remember I used to have a problem with accessRules() for authenticated users making ajax request if the user session has expired the return result is the login page. Was there a thought on this while developing Yii2? :)

cheers,
bettor
0

#2 User is offline   CeBe 

  • Advanced Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 532
  • Joined: 16-July 10
  • Location:Berlin. Germany

Posted 14 June 2013 - 07:57 AM

There will be a different HTTP responsecode + Location header that points to login page, so you can handle situation in your JS code:

\yii\web\User.php#L288
\yii\web\Response.php#L503
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users