Egg::Model::Session::ID::UniqueID - 'mod_uniqueid' is used for session ID.


Egg-Plugin-SessionKit documentation Contained in the Egg-Plugin-SessionKit distribution.

Index


Code Index:

NAME

Top

Egg::Model::Session::ID::UniqueID - 'mod_uniqueid' is used for session ID.

SYNOPSIS

Top

  package MyApp::Model::Sesion::MySession;

  __PACKAGE__->startup(
   .....
   ID::UniqueID
   );

DESCRIPTION

Top

Enhancing module 'mod_uniqueid' of Apache is used for session ID.

The WEB server should set up to use it and Apache and mod_uniqueid have set it up.

see http://www.apache.org/.

METHODS

Top

make_session_id

The value of environment variable 'UNIQUE_ID' is returned.

valid_session_id (SESSION_ID)

The result of the format check of session ID is returned.

SEE ALSO

Top

Egg::Release, Egg::Model::Session::Manager::TieHash, http://www.apache.org/, http://httpd.apache.org/docs/2.0/ja/mod/mod_unique_id.html,

AUTHOR

Top

Masatoshi Mizuno <lushe&64;cpan.org>

COPYRIGHT AND LICENSE

Top


Egg-Plugin-SessionKit documentation Contained in the Egg-Plugin-SessionKit distribution.

package Egg::Model::Session::ID::UniqueID;
#
# Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt>
#
# $Id: UniqueID.pm 256 2008-02-14 21:07:38Z lushe $
#
use strict;
use warnings;
use Carp qw/ croak /;

our $VERSION= '0.01';

sub make_session_id {
	$ENV{UNIQUE_ID} || die q{ $ENV{UNIQUE_ID} variable cannot be acquired. };
}
sub valid_session_id {
	my $self= shift;
	my $id= shift || croak q{I want session id.};
	$id=~m{^[A-Za-z0-9\@\-]{19}$} ? $id : (undef);
}

1;

__END__