1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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