开发者

Can cookie be set on my own domain even the request is proxy from another server?

开发者 https://www.devze.com 2023-03-29 17:16 出处:网络
So, here are the scenarios: 1) Normal situation Request: Client Browser ->(HTTP Request) -> MyServer.com

So, here are the scenarios:

1) Normal situation

Request:
Client Browser ->(HTTP Request) -> MyServer.com 
Response:
MyServer.com -> (HTTP Response with Cookie on MyServer.com) -> clientBrowser
  • Cookie is set in MyServer.com domain.

2) Proxy situation

Request:
Client Browser ->(HTTP Request) -> ProxyServer.com -> (Http Request) -> MyServer.com 
Response:
MyServer.com -> (HTTP Response with Cookie on MyServer.com) -> ProxyServer.com -> (Http Response with ???) -> clientBrowser

Questions are:

a) ProxyServer will see my cookie in the Http Response, right? (in the http response header).

b) Will ProxyServer.com be able to set the cookie (coming from Myserver.com ) in Myserver.com do开发者_如何学Gomain?


You can explicitly set the domain of a cookie yourself while creating the cookie..

This is how it can be done in php

bool setcookie ( string $name [, string $value [, int $expire = 0 [, string $path [, string $domain [, bool $secure = false [, bool $httponly = false ]]]]]] )

Google for other scripting languages..

Is this what you were looking for??

0

精彩评论

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

关注公众号