开发者

Django: Store user id in cookie

开发者 https://www.devze.com 2023-03-23 21:58 出处:网络
I\'d like to store a unique user identifier开发者_如何学编程 in a cookie (in order to be able to include it in the apache log). I\'m thinking of overriding the login method and setting the cookie on s

I'd like to store a unique user identifier开发者_如何学编程 in a cookie (in order to be able to include it in the apache log). I'm thinking of overriding the login method and setting the cookie on success.

Does that sound right? Any reason I should not do this, or is there a better way? Is there a code snippet that already does this?


That linked answer uses the Django session cookie, which is already set automatically.

0

精彩评论

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

关注公众号