Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to use ajax for login?

Am about to include a log in system to my web Site but i don't think it's a good idea for security to use ajax to send a and receive confirmation from an external php script called login.php and log-out the same way with another logout.php any recommendation

like image 785
Qchmqs Avatar asked Aug 04 '11 09:08

Qchmqs


People also ask

Is it safe to send password over AJAX?

Make sure that you're sending it via POST and use SSL rather than plain old http and you should be fine. Sending it via AJAX does not make it less safe than a regular post.

Are there any downsides of using AJAX?

The Downsides of Using Ajax The major drawback is its massive usage and dependency on JavaScript. It should be noted that JavaScript is implemented differently for various browsers, such as Internet Explorer, Netscape, Mozilla, and so on.

Do websites still use AJAX?

Yes, AJAX (XHR) is used all the time in web pages. It is still the primary way that JavaScript in a web page makes an in-page request to a server.

What is AJAX best used for?

AJAX allows web pages to be updated asynchronously by exchanging data with a web server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.


1 Answers

Security

AJAX is a as safe as a plain old form + refresh page. In the end it's always an HTTP request. Why do you think that ?

However, from a usability point, make sure that people that disable javascript can still log into your app.

Be sure to use POST method to send your AJAX request, as GET requests, and their params (such as, let's say, plain-text password) might end in your web server logs, unles you are using HTTPS.

Usability

As Grégoire pointed it out:

Also from a usability point, autocomplete won't work for AJAX forms on chrome, and for AJAX-loaded forms in firefox. The browsers won't even propose to remember your password

like image 64
Clement Herreman Avatar answered Oct 06 '22 18:10

Clement Herreman