1 package Maypole::Session;
5 Maypole::Constants - Maypole predefined constants
11 my $uid = Maypole::Session::generate_unique_id()
15 This class provides session related methods for Maypole such as unique id's for requests.
19 =head2 generate_unique_id()
21 my $uid = Maypole::Session::generate_unique_id()
23 generates a unique id and returns it, requires no arguments but accepts size, default is 32.
30 sub generate_unique_id {
31 my $length = shift || 32;
32 my $id = substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, $length);
37 ###################################################################################################
38 ###################################################################################################
47 Aaron Trevena, c<teejay@droogs.org>
51 Simon Cozens, C<simon@cpan.org>
55 You may distribute this code under the same terms as Perl itself.