vronic / chrome-rest-client

Automatically exported from code.google.com/p/chrome-rest-client
0 stars 0 forks source link

Not allowing to set "Cookie:" #39

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  In the request header form, we enter a Cookie header
2.  "This header can't be set" error shows up, and the value for the Cookie 
cannot be entered
3.

What is the expected output? What do you see instead?

Currently, the Advanced REST client forbids the client from entering values for 
Cookies, but allows the values for the Set-Cookie header.

Methinks it should be the other way around, Set-Cookie: should not be allowed 
to be set in the request, but Cookie:  should certainly work

What version of the product are you using? On what operating system?

1/2/2012, the one available from the Chrome marketplace
Running Chrome 16.0.912.63 in WinXP

Please provide any additional information below.

Thanks very much for developing this very useful plugin!

Original issue reported on code.google.com by Stan.R...@gmail.com on 5 Jan 2012 at 7:07

GoogleCodeExporter commented 8 years ago
"Set-Cookie" header sent with request to server do nothing. It do not set's any 
cookie value. Only "Cookie" and "Cookie2" headers are valid to servers as a 
cookie values. 
Normally server will treat "Set-Cookie" header as a custom header value.
But it is not possible to set "Cookie" header because specification not allow 
it.
See http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method for more 
information.

Original comment by jarro...@gmail.com on 6 Jan 2012 at 11:30

GoogleCodeExporter commented 8 years ago
Thank you for your reply.  This is a testing tool, very useful for accessing 
individual RESTful services.  Sometimes, we do not have access to a service 
that sets the appropriate cookies in the browser.  Instead, we are given 
example cookie values to pass to another service, which we could then enter in 
the header.

If the problem is with the Advanced REST Client using XMLHttpRequest 
internally, maybe another approach would allow the setting of cookies.  It is 
possible for a Chrome extension to set a browser cookie; see, for example, 
Cookie Manager 
(https://chrome.google.com/webstore/detail/kbnfbcpkiaganjpcanopcgeoehkleeck).  
I wonder if similar functionality of setting a cookie would be possible from 
your app.

Original comment by Stan.R...@gmail.com on 6 Jan 2012 at 5:21

GoogleCodeExporter commented 8 years ago
Looks like this restriction is on Chrome's side:

https://code.google.com/p/chromium/issues/detail?id=171220

Original comment by ryan.shi...@devfactory.com on 2 Oct 2013 at 4:59