Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COHi @Darin, thank you for your response. Actually, it's the opposite behaviour I want - I would like my app to always go back to the login page, regardless of whether it's an Ajax or regular call. I don't want to have to responde to a 401 in every AJAX call I make - I want it to be standard behaviour built in to my base controller. And because Ajax forms generally render a portion of the page in a div, I need my Login form to be a full page redirection - not to be displayed in the div section. Thanks, Simon.
      singulars
    2. CO@Simon, the thing is that when you use AJAX and if your server doesn't return 401 status code you have no way of knowing whether you god redirected to the logon page (because the session expired) or if you got served the correct page. In both cases you get 200 status code and HTML. So you can't act accordingly. If you configure your server to return 401 status code in case of expired session you will be able to use `window.location.href` in your AJAX 401 error callback because you will know that the session expired and simply redirect the browser to the logon page.
      singulars
    3. COHi Darin, thanks for your advice. My next question would then be, how can I set up this behaviour by default? I have literally hundreds of AJAX calls peppered throughout my app. I really don't want to have to specifically handle this condition in every one manually. Is there a way to set this default behaviour up, perhaps using JQuery?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload