Forum Moderators: open

Message Too Old, No Replies

trying to send cookie back to server, not working

         

welkin

8:32 am on May 20, 2007 (gmt 0)

10+ Year Member



So I'm trying to automate a form submission with socket programming. After entering username/passwd, here's the msg I get from the server:

HTTP/1.1 302 Found
Date: Sun, 20 May 2007 08:17:01 GMT
Server: Apache/2.2.4 (Unix) mod_ssl/2.2.4 OpenSSL/0.9.7a DAV/2 PHP/5.2.0 mod_python/3.3.1 Python/2.3.4 SVN/1.4.3
X-Powered-By: PHP/5.2.0
Set-Cookie: SESSION=cafdjibog49ksu3ju2jvfh2ia4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Location: http://www.example.com/risk
Content-Length: 0
Content-Type: text/html

And I reply with

GET /risk HTTP/1.1
Host: www.example.com
Cookie: SESSION=cafdjibog49ksu3ju2jvfh2ia4
User-Agent: HTTPTest/1.0

And yet somehow the server doesn't recognize the cookie I send back. Is there anything I'm missing? Thanks!

[edited by: encyclo at 12:48 pm (utc) on May 20, 2007]
[edit reason] See Guide to Posting Code [webmasterworld.com] [/edit]

penders

8:54 am on May 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Shouldn't you be sending back "
Set-Cookie:
" rather just "
Cookie:
" ...?

welkin

10:24 pm on May 20, 2007 (gmt 0)

10+ Year Member



Hmm... somehow I got it to work by incorporating a random string as the cookie (after looking at the HTTP packets), and then it stops replying with the Set-Cookie header. Anyone has any ideas why?