Can cookie be set on my own domain even the request is proxy from another server?
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??
精彩评论