Is either GET or POST more secure than the other?

前端 未结 27 2025
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 05:13

When comparing an HTTP GET to an HTTP POST, what are the differences from a security perspective? Is one of the choices inherently more secure than the other? If so, why?

27条回答
  •  南笙
    南笙 (楼主)
    2020-11-22 06:00

    Even if POST gives no real security benefit versus GET, for login forms or any other form with relatively sensitive information, make sure you are using POST as:

    1. The information POSTed will not be saved in the user's history.
    2. The sensitive information (password, etc.) sent in the form will not be visible later on in the URL bar (by using GET, it will be visible in the history and the URL bar).

    Also, GET has a theorical limit of data. POST doesn't.

    For real sensitive info, make sure to use SSL (HTTPS)

提交回复
热议问题