Django,依赖会话

发布于 2024-08-22 14:30:31 字数 102 浏览 2 评论 0原文

我或多或少地在会话上大量构建我的网站(特别是重定向用户等),我很好奇这是否是一种危险的做法。禁用浏览器 cookie 保存的用户的大致比例是多少?我愿意接受任何建议:)

谢谢

Less or more I am building my site heavly on sessions(especially for redirecting users etc), I am curious if this a dangerous practice. What would be the rough percentage of users who have disabled their cookie saving with their browsers ? I am open to any suggestions :)

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

安穩 2024-08-29 14:30:31

会话的主要问题不是禁用 cookie。反对会话的主要论点是它们使您的应用程序有状态。无状态服务有一些优点。

相关的论点是性能:会话通常是高负载下站点的瓶颈,它们使使用缓存变得更加困难,并且意味着为每个请求读取或写入存储。

在需要时使用会话很好,但如果可以的话最好避免使用它们。

The main issue with sessions is not the disabled cookies. The main argument against sessions is that they make your app stateful. Stateless services have some advantages.

The related argument is performance: sessions are often the bottleneck for sites under high load, they make it harder to use caching and imply reading or writing to storage for each request.

It is fine to use sessions when they are needed but it is better to avoid them if you can.

皓月长歌 2024-08-29 14:30:31

我敢说禁用 cookie 的用户比例为 0%。绝大多数普通互联网公众不会摆弄设置。

即使他们这样做了:尝试关闭您的 cookie 并访问任何受欢迎的网站。我们将迅速并不断地鼓励您重新打开 cookie :P

I would venture that the percentage of users with disabled cookies is 0%. The vast majority of the general internet public don't fiddle with settings.

Even if they did: try turning off your cookies and visiting any popular site. You will be quickly and continually encouraged to turn your cookies back on :P

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文