开发者

Django, relying on sessions

Less or more I am building my site heavly on sessions(especially for redirectin开发者_运维知识库g 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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜