Is it safe to use ajax for login?

后端 未结 6 1214
隐瞒了意图╮
隐瞒了意图╮ 2020-12-10 03:31

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 scri

6条回答
  •  忘掉有多难
    2020-12-10 04:30

    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

提交回复
热议问题