jquery - AJAX Auth required - what status code to use? -


Model and administrator login in my MVC application throw the necessary exceptions whenever a public user uses a secure resource Attempts are listening for the errors of dispatch and when I know that there is a LoginRequired exception, then I create and return a custom response.

If the request was a normal HTTP request, things are simple - I redirect 302, and the 'Location' login page. But what will happen when AJX requests?

I've read about setting up a header here, then looking for a global Ajax handler handler. I can not make any problems, but surely there should be an HTTP status code to deal with this?

What would be a good alternative to code? I need one which is a fair fit, but no type of behavior is being put on the user agent automatically.

You know I am not an expert in such things, but when I am able to start a resume I wanted to download some headers and you can send a costume request header with AJAX, and you can send some feedback titles with PHP and get them (anything) with AJAX but I It seems that the headers are useful, when both There are some effects on the sides or any top flag or ezax reaction is not different from a flag in the body.

Some headers and different behavioral browsers and browsers also send different headers when you send a request (ajax or raw, ...)

(only specific In small things). {'someFlallg': 'OK', 'visual': '--- body of material ---')

I hope that helps.


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -