NAME
CGI::Builder::Session - CGI::Builder and CGI::Session integration
VERSION 1.0
To have the complete list of all the extensions of the CBF, see "Extensions List" in CGI::Builder
INSTALLATION
- Prerequisites
-
CGI::Builder >= 1.0 CGI::Session >= 3.95 File::Spec > 0
- CPAN
-
perl -MCPAN -e 'install CGI::Builder::Session'
If you want to install all the extensions and prerequisites of the CBF, all in one easy step:
perl -MCPAN -e 'install Bundle::CGI::Builder::Complete'
- Standard installation
-
From the directory where this file is located, type:
perl Makefile.PL make make test make install
SYNOPSIS
use CGI::Builder
qw| CGI::Builder::Session
...
|;
DESCRIPTION
This is a very simple module which integrates CGI::Builder
and CGI::Session
and provides you a ready to use CGI::Session object (cs
property) useful to maintain the state of your application between requests. Please refer to CGI::Session for more documentation.
PROPERTY ACCESSORS
This module adds one property to the standard CBF properties.
cs
This property returns the internal CGI::Session
object that is automatically created just before you use it. It is already initialized with the existing session or with a new session if there are no existing session yet. Anyway, you can directly use it in your code without any other initialization.
# check some flag
sub OH_pre_process {
my $s = shift;
$s->cs->param('logged')
|| switch_to('login');
}
# saves cgi parameter for later use
sub PH_myPage1 {
my $s = shift;
$s->cs->save_param($s->cgi, "category");
}
# retrieve a session parameter saved in a previous request
sub PH_myPage2 {
my $s = shift;
my $categ = $s->cs->param("category");
}
Note: You can completely override the creation of the internal object by overriding the cs_new()
method.
METHODS
cs_new()
This method is not intended to be used directly in your CBB. It is used internally to initialize and returns the CGI::Session
object with the more compatible and multi platform defaults, that are:
CGI::Session->new( undef, # DNS equal to File
$s->cgi ,
{ Directory => File::Spec->tmpdir }
);
Note: You should redefine this method in your CBB if you need some more customized object. (see CGI::Session).
SUPPORT and FEEDBACK
You can join the CBF mailing list at this url:
http://lists.sourceforge.net/lists/listinfo/cgi-builder-users
AUTHOR and COPYRIGHT
© 2004 by Domizio Demichelis (http://perl.4pro.net)
All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 126:
Non-ASCII character seen before =encoding in '©'. Assuming CP1252