开发者

How to share a session with a php application

开发者 https://www.devze.com 2023-01-02 04:07 出处:网络
I have a django blog project and a ch开发者_运维技巧at in PHP. I need to share the id of the user logged in django ( request.user.id ) with the chat in PHP.

I have a django blog project and a ch开发者_运维技巧at in PHP.

I need to share the id of the user logged in django ( request.user.id ) with the chat in PHP.

Is this possible ?


I don't think using sessions in this way is a good idea, since they're designed to keep data temporarily for a certain user in an application. It might be a better idea to store the id in a cookie and read that in the chat, or pass a variable in the link.


You could use HTTP authentication for this. As long as both applications are on the same domain and the realm name (sent in the WWW-Authenticate header) is the same for both, once a use logs into one or the other application, the REMOTE_USER variable will be available to both and will contain the username of the person logged in.


See http://groups.google.com/group/django-users/msg/a492cb9394b0db4d for one answer

0

精彩评论

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

关注公众号