Hello Monks,
Please look at the code below.For the first time when script is called it is displayed correctly but for any other pages after this prints the whole cookie information on top of the screen.And it works correctly with last parameter blank,but does not work if some value is passed.Please tell me where lies the problem.
Thanks
blazix
sub getCookieValues { require "cgi-lib.pl"; $called_by_admin = shift; $remVal = shift; $eventChoice = shift; $path = "../home/home.pl"; local($IDENTITY); my @UserInfo; my $sProjName; my $eventVal; if($IDENTITY = &parseCookie()){ #print &PrintHeader; @UserInfo = split(/\|/, $IDENTITY); if(($remVal ne "")||($eventChoice ne "")) { if($remVal ne "") { $eventVal = pop @UserInfo; $tempVal = pop @UserInfo; if($tempVal ne $remVal) { push @UserInfo,$remVal; push @UserInfo,$eventVal; $IDENTITY = join("|", @UserInfo); print "set-cookie: WBSession=$IDENTITY; p +ath=/cgi-bin;\n\n"; } else { push @UserInfo,$tempVal; push @UserInfo,$eventVal; $IDENTITY = join("|", @UserInfo); print "set-cookie: WBSession=$IDENTITY; p +ath=/cgi-bin;\n\n"; } } if($eventChoice ne "") { $eventVal = pop @UserInfo; if($eventVal ne $eventChoice) { push @UserInfo,$eventChoice; $IDENTITY = join("|", @UserInfo); print "set-cookie: WBSession=$IDENTIT +Y; path=/cgi-bin;\n\n"; } else { push @UserInfo,$eventVal; $IDENTITY = join("|", @UserIn +fo); print "set-cookie: WBSession= +$IDENTITY; path=/cgi-bin;\n\n"; } } } else { print &PrintHeader; } } else { $username = $in{'Username'}; $password = $in{'Password'}; $sProjName = $in{'Project'}; if($username && $password){ $IDENTITY = &setCookie($username, $password, $path, $sProj +Name,"rem","ALL EVENTS"); @UserInfo = split(/\|/, $IDENTITY); } else{ &login($path); } } $username = $UserInfo[1]; unless ($called_by_admin){ verifyUser($username); } return @UserInfo; } # end getCookieValues sub routine

In reply to where is the error ?? 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.