cookie problem

Discussion in 'Perl' started by bhavin12300, Apr 19, 2007.

  1. bhavin12300

    bhavin12300 New Member

    Joined:
    Apr 7, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    hi i have created one cgi scrips in which i am setting the value of the cookie but i am not able to retrieve the cookie value in the same program and able to access the same coolie from other program.
    following is my code
    please suggest me the correction in this
    Code:
    #! /usr/bin/perl
    use DBI;
    use CGI;
    
    $query = new CGI;
    
    $cookie = $query->cookie(-name=>'MY_COOKIE',
    -value=>'number=llllll',
    -expires=>'+4h',
    -path=>'/');
    print $query->header(-cookie=>$cookie);
    
    $query2 = new CGI;
    print $query2->header;
    
    $theCookie = $query2->cookie('MY_COOKIE');
    print $theCookie;
    
     
    Last edited by a moderator: Apr 19, 2007

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice