The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

CGI::Persist::Cookie

DESCRIPTION

CGI::Persist::Cookie is a cookie based front end to CGI::Persist with no data-footprint on the server. Everything is stored into the user's webbrowser.

This is not for fun and _only_ usefull when you have only few fields to remember and don't want the hassle of putting those fields into your HTML / template.

CGI::Persist::Cookie disables the data interface from CGI::Persist, to make sure the data serialized into the users browser is kept small.

SYNOPSIS

  my $cgi = CGI::Persist::Cookie->new( path => "/cgi",
                                       domain => "www.2organize.com",
                                       secure => 0,
                                       sessionTime => 900,
                                     );

  # add a parameter to the data.
  $cgi->param(-name => "Veggie", -value = "TRUE");

  # read a parameter from the data.
  $id = $cgi->param('id') || $cgi->ID;

  # check if the button was pushed.
  if ( $cgi->gotSubmit("the_button") ) {
    # ...
  }

  # check is the param is NOT this requested now
  if ( $cgi->param("the_param") && !defined $cgi->currentParam("the_param") ) {
    # ...
  }

  # and now, to make sure it keeps on working, print a cookied-header.
  print $cgi->header( -cookie => [ @all_my_cookies, $cgi->persistCookies ] );

ACCESSOR METHODS

  • path

  • domain

  • secure

    See CGI::Cookie for more information.

CAVEATS

SEE ALSO

CGI(3), CGI::Persist

AUTHOR

Hartog C. de Mik, hartog@2organize.com