Set-Cookie does not work

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am using socket programming and I am sending a request from client to
server, I have made this message in my program but somehow, the COOKIE
I set does not get to the server:

This is my message:

POST /cgi-bin/xxxxxx/xxxxxxxxxxxxx HTTP/1.1
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Connection: Keep-Alive
Cache-Control: no-cache
Set-Cookie: SessieString=xxxxxxxxxxxxxxxx;
path=/cgi-bin/xxxxxx/xxxxxxxxxxxxx; v


I did got some info, the parameter 'action' is read correctly at the
server side, but getting some debug info tells me that no Cookies are
present, at all, at the Server Side. Let alone the named Cookie

I feel, to put it diplomaticly, 'somewhat frustrated', trying all kinds
of things, and not knowing what I do wrong. I 've been prutsing with it
the whole day now...

I tried Cookie instead of Set Cookie, with and without the path en
version, and the letter with and without the semicolon. I used /r/n
since the server is on unix (Apache) and I am sending from a
windows-client (Little C program written in g++).


Please help me!

Re: Set-Cookie does not work wrote:

Quoted text here. Click to load it

The browser makes a request, which includes any cookies that are set

The server makes a response, which can set cookies.

Are you trying to read the cookies inside the script that just set them? If
so they won't exist yet.

David Dorward       < <
                     Home is where the ~/.bashrc is

Re: Set-Cookie does not work

On 05/01/2006 15:41, wrote:


Quoted text here. Click to load it

This is a POST request...


Quoted text here. Click to load it

...but Set-Cookie is a response header. You also seem to have a CRLF in
that value[1].

Quoted text here. Click to load it

If you send

   Cookie: SessieString=xxxxxxxxxxxxxxxx

there should be no problem.

Quoted text here. Click to load it

The path parameter is not included in a Cookie request header. The
Cookie header consists only of name/value pairs.

Quoted text here. Click to load it

There is no version parameter for either Cookie or Set-Cookie.

Quoted text here. Click to load it

I'm not quite sure what you mean there.

Quoted text here. Click to load it

It doesn't matter which operating system is used. Each header must be
terminated a CRLF pair (ASCII 13 + 10), and the entity body must be
separated from the headers by another CRLF pair.


[1] If that is just an error caused by automated wrapping from
     your newsreader, you should do yourself (and others) a favour
     by either explicitly noting the wrapping (to distinguish
     intent from error) or, even better, wrap manually and
     continue the header value on the following line (with the
     necessary linear white space).

       Set-Cookie: SessieString=xxxxxxxxxxxxxxxx;

Michael Winter
Prefix subject with [News] before replying by e-mail.

Site Timeline