NAME
CGI::Persist -- Web persistency made usable.
SYNOPSIS
my $cgi = CGI::Persist->new(sessionTime => 60);
DESCRIPTION
The base class for CGI::Persist::DBI and CGI::Persist::File, is NOT capable of storing anything for itself (not even using cookies - since they are evil)
This all gives you full access to the CGI interface.
FUNCTIONS
- new
-
( sessionTime => 900, logFile => " ", errorLogFile => " ", writeOnce => [ ], filter => [ ], mask => [ ], run => sub { return undef } );
Creates a new instance of the CGI::Persist object. Running this once should be enough.
- newSession
-
Creates a new session. It will not overwrite the current session object in the DB.
- newFromIdle
-
Is set to 1 if the previous session has dissapeared and a new session had to be created.
- firstRun
-
Is set to 1 if this is the first hit on a session.
- data (key)
- data (key => value)
-
If the only argument is a key, the matching piece of data is found to that, and returned. If a value is also submitted this will be stored.
In void context an anonymous hash is returned with all key => value pairs inside.
- currentParam
-
Holds the 'current' parameters (eg: the parameters that where found before the session was restored.);
- gotSubmit
-
Feature for checking (image)buttons have been pressed
- cleanUp
-
Will round up all the sessions older then sessionTime and ask to delete them.
- log
-
writes to the logFile
- errorLog
-
writes to the errorLogFile
- paramFetchHash
-
returns an anonymous hash of all parameters in memory.
- href
-
returns a CGI::href, but with an ID nicely tucked in there.
- stateUrl
-
return the current URL + '?ID=$ID'
- stateField
-
returns a hidden-field tag for your form holding ID and its value
WRITING YOUR OWN CHILD
isnt to hard. Just make sure it has the following routines:
openDB
closeDB
store
get
findOldSessions
clean($id)
And make sure that these routines do what their names promisse.
KNOWN BUGS
None so far.
THANKS TO
Robert Bakker <robert@2organize.com> Arno F. Roelofs <arnofr@2organize.com>
AUTHOR
Hartog C. de Mik <hartog@2organize.com>