Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC场景下,如何从客户端发送cookie到服务端? #21

Closed
ouerzc opened this issue Jun 29, 2016 · 3 comments
Closed

RPC场景下,如何从客户端发送cookie到服务端? #21

ouerzc opened this issue Jun 29, 2016 · 3 comments

Comments

@ouerzc
Copy link

ouerzc commented Jun 29, 2016

如题:
RPC场景下,如何从客户端发送cookie到服务端?

@andot
Copy link
Member

andot commented Jul 1, 2016

hprose 会自动传递服务器端设置的 cookie,用户不能自己从客户端发送 cookie 到服务器。

@ouerzc
Copy link
Author

ouerzc commented Jul 1, 2016

好的,谢谢

@andot
Copy link
Member

andot commented Jul 1, 2016

不客气。这样做有两个原因,第一个原因是并非所有平台提供的 HTTP 通讯都支持让用户设置 Cookie,比如在浏览器中,使用 XHR 虽然可以设置一些自定义的 HTTP 头,但是是不能设置 Cookie 的。第二个原因是 hprose 支持多种底层传输协议,所以用户在构建服务时,最好是不要依赖某个特定传输协议的功能,能直接使用 RPC 方式传递的数据,尽量使用 RPC 方式传递,这样可以方便底层协议替换。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants