Apache::Session::Generate::UUID - UUID for session ID generation


Apache-Session-Generate-UUID documentation Contained in the Apache-Session-Generate-UUID distribution.

Index


Code Index:

NAME

Top

Apache::Session::Generate::UUID - UUID for session ID generation

SYNOPSIS

Top

  use Apache::Session::Flex;

  tie %session, 'Apache::Session::Flex', $id, {
      Store     => 'MySQL',
      Lock      => 'Null',
      Generate  => 'UUID',
      Serialize => 'Storable',
  };

DESCRIPTION

Top

Apache::Session::Generate::UUID extends Apache::Session to allow you to create UUID based session ids. This module fits well with long-term sessions, so better using RDBMS like MySQL for its storage.

CONFIGURATION

Top

There are no configuration options.

FUNCTIONS

Top

generate

validate

AUTHOR

Top

Nick Gerakines, <nick at socklabs.com>

BUGS

Top

Please report any bugs or feature requests to bug-apache-session-generate-uuid at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Apache-Session-Generate-UUID. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Apache::Session::Generate::UUID

You can also look for information at:

* Wikipedia: UUID

http://en.wikipedia.org/wiki/UUID

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Apache-Session-Generate-UUID

* CPAN Ratings

http://cpanratings.perl.org/d/Apache-Session-Generate-UUID

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache-Session-Generate-UUID

* Search CPAN

http://search.cpan.org/dist/Apache-Session-Generate-UUID

COPYRIGHT & LICENSE

Top


Apache-Session-Generate-UUID documentation Contained in the Apache-Session-Generate-UUID distribution.

# $Id: $ $Revision: $ $Source: $ $Date: $

package Apache::Session::Generate::UUID;

use strict;
use warnings;

use Data::UUID;

our $VERSION = '0.2';

sub generate {
    my ($session) = @_;
    return $session->{'data'}->{'_session_id'} = Data::UUID->new->create_str();
}

sub validate {
    my ($session) = @_;
    if ($session->{'data'}->{'_session_id'} !~ /^[a-fA-F0-9\-]+$/xm) { die; }
    return 1;
}

1;
__END__