>
 
> > Do you have a specific question? it seems:
> > 
> > http://search.cpan.org/author/LDS/CGI.pm-2.89/CGI.pm#HTTP_COOKIES 
> > 
> > Covers things pretty extensively, short of looking at the 
> > source to see how things are implemented rather than just the 
> > API.  Really very little to them.
> 

I have a real question now :)
All am I am trying to do now is have a user enter his/her name in a form and
have that saved to a cookie, so when they return, they will get something
like " Your juser, please proceed" . I took the example here:
http://stein.cshl.org/WWW/CGI/examples/cookie.cgi

Below is the code I am working with.  But when I return to the page I just
get the form again. What am i missing. Sorry if this is obvious, but i am
not getting it and I have read the tutorial and the RFC on http state
(thanks John ).

Thanks
---

use CGI qw(:standard);

# Recover  previous cookie if there is one.
%all = cookie('users');

# Recover the new users(s) from the parameter 'new_users'
@new = param('new_users'); 

# Add new animals to old, and put them in a cookie
$cookie = cookie(-name=>'users',
                     -value=>\%all,
                     -expires=>'+1h');

# Print the header, incorporating the cookie and the expiration date...
print header(-cookie=>$cookie);

# Now we're ready to create our HTML page.
print start_html('Test cookie');

if (%all) {                     # this should print the user stored in
cookie ??
        foreach $key ( keys %all) {
                print "<p>$all{$key}</p>";
    }
}


print qq(
<FORM METHOD="POST"  ENCTYPE="application/x-www-form-urlencoded">
<P>User Name <INPUT TYPE="text" NAME="new_users" ></P>
<P> <INPUT TYPE="submit" NAME="submit"> </P>
<P><INPUT TYPE="submit" NAME="defaults" VALUE="Clear Form"></P>
);

print end_html;


 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to