Django HTTPS和HTTP会话

编程入门 行业动态 更新时间:2024-10-18 18:23:47
本文介绍了Django HTTPS和HTTP会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

通过HTTPS创建的会话数据(身份验证等)在HTTP部分中不可用该网站。

什么是使其可用的最佳方法,而不必使整个网站HTTPS?

解决方案

这是设计而不是你可以随便改变的东西。

请记住,此未经身份验证的Cookie以明文形式发送电线,打开您的用户欺骗和重播攻击。这可能与您的申请无关。

I'm using Django 1.1.1 with the ssl redirect middleware.

Sessions data (authentication etc.) created via HTTPS are not available in the HTTP portions of the site.

What is the best way to make it available without having to make the entire site HTTPS?

解决方案

This is by design, and not something you can readily change.

Cookies/authentication sent via HTTPS are not sent by the browser when the same site is viewed via HTTP. Your best solution is probably to redirect the user from a HTTPS page to a HTTP page that sets your authentication cookie.

Keep in mind that this unauthenticated cookie, sent in plaintext over the wire, opens your users to spoofing and replay attacks. This may not matter for your application.

更多推荐

Django HTTPS和HTTP会话

本文发布于:2023-11-28 14:18:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642757.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Django   HTTPS   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!