Hi,

i have a perl app that behaves strange. it happens when i try to login and then redirect to the front page upon success.
the problem is that the cookie is somehow lost. strange thing is that it works for firefox but not IE.

code is simple as:

my $cookie = $q->cookie( -name => 'auth_tkt', -value => $tkt, -expires => '+1h', ); $q->redirect( -uri => $uri, -cookie => $cookie );
here is FF header:
POST /app/account/process_login HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7 +) Gecko/20070914 Firefox/2.0.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 +,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.example.com/app/account/login Content-Type: application/x-www-form-urlencoded Content-Length: 40 back=&username=testuser&password=1234567 HTTP/1.x 302 Found Date: Fri, 12 Oct 2007 00:39:23 GMT Server: Apache/1.3.36 (Unix) mod_auth_tkt/2.0.0rc2 mod_perl/1.29 Set-Cookie: auth_tkt=YTg3OWYyZjVlYmQ5ZTllM2Q3NWExNzdmMTRhMjI3ZGI0NzBlY +zIzYnRlc3R1c2VyITI%3D; path=/; expires=Fri, 12-Oct-2007 01:39:23 GMT Location: /app Keep-Alive: timeout=15, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/plain ---------------------------------------------------------- http://www.example.com/app GET /app HTTP/1.1 Host: www.example.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7 +) Gecko/20070914 Firefox/2.0.0.7 Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9 +,text/plain;q=0.8,image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: http://www.example.com/app/account/login Cookie: auth_tkt=YTg3OWYyZjVlYmQ5ZTllM2Q3NWExNzdmMTRhMjI3ZGI0NzBlYzIzY +nRlc3R1c2VyITI%3D HTTP/1.x 200 OK Date: Fri, 12 Oct 2007 00:39:24 GMT Server: Apache/1.3.36 (Unix) mod_auth_tkt/2.0.0rc2 mod_perl/1.29 Keep-Alive: timeout=15, max=98 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1 ----------------------------------------------------------
here is IE header
POST /app/account/process_login HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicati +on/msword, application/x-shockwave-flash, application/vnd.ms-excel, a +pplication/vnd.ms-powerpoint, */* Referer: http://www.example.com/app/account/login Accept-Language: en-us,en;q=0.5 Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .N +ET CLR 1.0.3705; .NET CLR 1.1.4322) Host: www.example.com Content-Length: 40 Connection: Keep-Alive Cache-Control: no-cache back=&username=testuser&password=1234567 HTTP/1.1 302 Found Date: Fri, 12 Oct 2007 00:01:20 GMT Server: Apache/1.3.36 (Unix) mod_auth_tkt/2.0.0rc2 mod_perl/1.29 Set-Cookie: auth_tkt=NmY4ZDFiZDZhODgxZTk0ZTkwNDIyZjU5MmRmNGMwY2Q0NzBlY +jk1MXRlc3R1c2VyITI%3D; path=/; expires=Fri, 12-Oct-2007 01:01:21 GMT Location: /app Keep-Alive: timeout=15, max=99 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/plain GET /app HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicati +on/msword, application/x-shockwave-flash, application/vnd.ms-excel, a +pplication/vnd.ms-powerpoint, */* Referer: http://www.example.com/app/account/login Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .N +ET CLR 1.0.3705; .NET CLR 1.1.4322) Host: www.example.com Connection: Keep-Alive Cache-Control: no-cache HTTP/1.1 200 OK Date: Fri, 12 Oct 2007 00:01:21 GMT Server: Apache/1.3.36 (Unix) mod_auth_tkt/2.0.0rc2 mod_perl/1.29 Keep-Alive: timeout=15, max=98 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html; charset=ISO-8859-1

In reply to [OT] 302 redirect after login result cookie lost? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.