简体   繁体   English

如何从Openshift云中运行的节点服务器中检索会话Cookie

[英]how to retrieve session cookie from a node server running in openshift cloud

I have a node server.It uses express for session handling . 我有一个节点服务器。它使用express进行会话处理。

I have set httpOnly: false . 我已经设置了httpOnly: false I am trying to retrieve the session cookie from a cordova app running on localHost. 我正在尝试从在localHost上运行的cordova应用程序检索会话cookie。 when I run the node server on localhost I can retrieve the cookie, but when I run the same node server on Openshift cloud ,I can not retrieve the cookie . 当我在本地主机上运行节点服务器时,我可以检索cookie,但是当我在Openshift云上运行相同的节点服务器时,我无法检索该cookie。 why is it so? 为什么会这样呢?
My express Session configuration is as follows: 我的快速会话配置如下:

{name:'session.id',
secret: 'xyz',
resave:false,
saveUninitialized:false,
cookie: { maxAge: null,httpOnly:false}}

经过一番谷歌搜索后,我发现新浏览器中禁止跨域会话cookie读取。因此,我无法读取cookie。但是由于在这种情况下我可以控制服务器,因此可以从服务器中检索cookie。通过使用对我的服务器的常规GET请求。

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

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