Set-Cookie with discard in a perl CGI?

Discussion in 'Perl Misc' started by Norman Ackroyd, Sep 10, 2004.

  1. I've got a CGI script that is going to set a cookie and I would like
    to be able to use some of the attributes specified in RFC2965
    (ftp://ftp.isi.edu/in-notes/rfc2965.txt) such as "discard" . CGI.pm
    appears to only support cookie attributes specified in the original
    "HTTP State Management Mechanism" - RFC2109 document. Besides building
    my response from scratch and a Socket connect, are there any cgi
    modules out there that will do this?

    Thanks,
    Norm Ackroyd
    Norman Ackroyd, Sep 10, 2004
    #1
    1. Advertising

  2. Norman Ackroyd wrote:
    > I've got a CGI script that is going to set a cookie and I would
    > like to be able to use some of the attributes specified in RFC2965
    > (ftp://ftp.isi.edu/in-notes/rfc2965.txt) such as "discard" . CGI.pm
    > appears to only support cookie attributes specified in the
    > original "HTTP State Management Mechanism" - RFC2109 document.


    If that's the case, it's not very difficult to print the cookie
    'manually':

    print "Set-cookie: name=value; path=/; otherattr\n";

    Then you can include whichever attributes you believe the browsers
    will understand. :)

    Of course, depending on what the cookie may contain, you may need to
    URI escape it.

    > Besides building my response from scratch and a Socket connect,


    ?

    > are there any cgi modules out there that will do this?


    A search at CPAN should give you the answer to that question.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
    Gunnar Hjalmarsson, Sep 10, 2004
    #2
    1. Advertising

  3. Gunnar Hjalmarsson wrote:

    >> Besides building my response from scratch and a Socket connect,

    >
    > ?


    Indeed. You dont need to open a socket to print to stdout!

    gtoomey
    Gregory Toomey, Sep 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Smith
    Replies:
    2
    Views:
    371
    Shane Petroff
    Jul 24, 2003
  2. Leif K-Brooks
    Replies:
    5
    Views:
    325
    David Fraser
    Apr 15, 2005
  3. Replies:
    1
    Views:
    248
  4. Xeno Campanoli
    Replies:
    2
    Views:
    132
    Xeno Campanoli
    Jul 10, 2008
  5. Phil Powell
    Replies:
    2
    Views:
    181
    Grant Wagner
    Sep 5, 2003
Loading...

Share This Page