Apache2-WebApp-Plugin-Session-File
view release on metacpan or search on metacpan
lib/Apache2/WebApp/Plugin/Session/File.pm view on Meta::CPAN
return bless( {}, $class );
}
#----------------------------------------------------------------------------+
# create( \%controller, $name, \%data )
#
# Create a new file based session and set a web browser cookie.
sub create {
my ( $self, $c, $name, $data_ref )
= validate_pos( @_,
{ type => OBJECT },
{ type => HASHREF },
{ type => SCALAR },
{ type => HASHREF }
);
$self->error('Invalid session name')
unless ( $name =~ /^[\w-]{1,20}$/ );
my $doc_root = $c->config->{apache_doc_root};
lib/Apache2/WebApp/Plugin/Session/File.pm view on Meta::CPAN
}
#----------------------------------------------------------------------------+
# get( \%controller, $arg )
#
# Takes the cookie unique identifier or session id as arguments. Returns
# the session data as a hash reference.
sub get {
my ( $self, $c, $arg )
= validate_pos( @_,
{ type => OBJECT },
{ type => HASHREF },
{ type => SCALAR }
);
$self->error('Malformed session identifier')
unless ( $arg =~ /^[\w-]{1,32}$/ );
my $doc_root = $c->config->{apache_doc_root};
lib/Apache2/WebApp/Plugin/Session/File.pm view on Meta::CPAN
}
#----------------------------------------------------------------------------+
# delete( \%controller, $arg )
#
# Takes the cookie unique identifier or session id as arguments. Deletes
# an existing session.
sub delete {
my ( $self, $c, $arg )
= validate_pos( @_,
{ type => OBJECT },
{ type => HASHREF },
{ type => SCALAR }
);
$self->error('Malformed session identifier')
unless ( $arg =~ /^[\w-]{32}$/ );
my $doc_root = $c->config->{apache_doc_root};
lib/Apache2/WebApp/Plugin/Session/File.pm view on Meta::CPAN
}
#----------------------------------------------------------------------------+
# update( \%controller, $arg, \%data );
#
# Takes the cookie unique identifier or session id as arguments. Updates
# existing session data.
sub update {
my ( $self, $c, $arg, $data_ref )
= validate_pos( @_,
{ type => OBJECT },
{ type => HASHREF },
{ type => SCALAR },
{ type => HASHREF }
);
$self->error('Malformed session identifier')
unless ( $arg =~ /^[\w-]{32}$/ );
my $cookie = $c->plugin('Cookie')->get($arg);
lib/Apache2/WebApp/Plugin/Session/File.pm view on Meta::CPAN
return;
}
#----------------------------------------------------------------------------+
# id( \%controller, $name )
#
# Return the cookie unique identifier for a given session.
sub id {
my ( $self, $c, $name )
= validate_pos( @_,
{ type => OBJECT },
{ type => HASHREF },
{ type => SCALAR }
);
$self->error('Malformed session identifier')
unless ( $name =~ /^[\w-]{32}$/ );
return $c->plugin('Cookie')->get($name);
}
( run in 0.255 second using v1.01-cache-2.11-cpan-4d50c553e7e )