简体   繁体   English

在nodejs和php之间共享cookie

[英]share cookie between nodejs and php

I want to use SSL for nodejs to secure socketio communication, so I need to use SSL for both apache and node. 我想对Node.js使用SSL来保护套接字通信,因此我需要对Apache和Node都使用SSL。

In order to have ability to share cookie between php and node, I have to use same domain name . 为了能够在php和node之间共享cookie,我必须使用相同的域名。

but if I can not use 443 for same domain that uses both nodejs and php same time. 但是如果我不能将443用于同时使用nodejs和php的同一域。

how can I solve this problem 我怎么解决这个问题

Use a reverse proxy such as haproxy to proxy requests to either Apache or node. 使用反向代理(例如haproxy)将请求代理到Apache或节点。

For the actual sharing of sessions between node and PHP (via redis) see this answer . 对于节点和PHP之间会话的实际共享(通过redis),请参见此答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM