This is a newbie question to AJAX experts: In case an unauthenticated user tries to post a comment to an article and send it to the server through AJAX, I need the remote PHP script to return...
- a 401 and a logon/password form which the user will fill and try again, or
- a 301 to redirect the user to a full-page logon/password form which, if successfull, will then return the user to the original comment page.
If possible, I'd rather use AJAX for both authentication + posting, so that the user doesn't need to see a full page just for authentication. Is it possible? FWIW, I'm using jQuery to learn about AJAX.
Thank you.