I assume your making a script to connect to a webserver, or are actually making a webserver, in any event, the following is how a cookie is
sent; i.e. from a client to a server;
GET /dir/filename.ext HTTP/1.0
Accept: */*
Referer:
http://whatever.com/Accept-Language: en-gb
User-Agent: Mozilla/4.0
Host: server.com
Connection: Close
Cookie: name1=data1; name2=data2; name3=data3;All of the above should be pretty familiar, most of it isn't needed, mainly just Host/GET/POST but thats how a client sends a cookie to a server.
And, the following is how the server, gets the client to
STORE a cookie;
HTTP/1.1 200 OK
Date: date-goes-here
Server: Apache
Set-Cookie: cookiename=cookiedata; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMTPragma: no-cache
Keep-Alive: timeout=1, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=iso-8859-15
HTML-FROM-WEBSITE-WOULD-BE-HERE.
As I said above you should again be familiar with all the above data that comes from the server, it appears just before you recieve its html data, usually you might find it only has the first line.
Hope this helps.
Eamonn.