HTTPS 切换到 HTTP
我使用 http:// 登录网页,我被 javascript 重定向到 https://。这将在 https 下打开一个登录页面。登录成功后,下一页又是http了。为什么下一页也没有用 https 打开。我使用 JETTY 作为网络服务器。
I login to a webpage using http:// I get redirected by javascript to https://. This opens a login page under https. After logging on successfully the next page is in http again. Why didn't the next page open with https as well. I am using JETTY as web server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否将登录表单发布到 http://mysite.com/login.php< /强>?
如果是这样,我建议使用相对链接(例如
Are you posting your login form to http://mysite.com/login.php?
If so, I'd recommend using a relative link (e.g.
<form action="login.php" method="POST">
)加密通常仅在传输用户名和密码(或您的网上银行帐户)等敏感数据时使用。
对于像 StackOverflow 这样的公共网站,除了登录凭据之外,使用 HTTPS 进行其他任何操作都是不切实际的,因为如果 StackOverflow 上的每个登录用户都将 HTTPS 用于每个页面视图,则该网站的运行成本可能会太高,因为加密会占用大量资源,这意味着这将需要更多的硬件。
服务器端软件可以在登录页面上进行如下工作:
HTTP 支持使用 Location 命令在标头中进行重定向:
希望这会有所帮助!
Encryption is usually only used when transferring sensitive data such as usernames and passwords (or your online bank account).
For an otherwise public website like StackOverflow it's impractical to use HTTPS for anything other than the login credentials because if every logged in user at StackOverflow would use HTTPS for every page-view the site could be too expensive to run because encryption is resource heavy which means it would require more hardware.
The server-side software could work something like this at the login page:
HTTP supports redirects in the header using the Location command:
Hope this helps!