1 package Maypole::Session;
5 Maypole::Session - Session related functionality for maypole
11 my $uid = Maypole::Session::generate_unique_id()
15 This class provides session related methods for Maypole such as unique id's for
18 Currently it provides only the generate_unique_id() function, by checking the
19 id's generated by this function and included in submitted forms, it is possible
20 to see if a form has been submitted before.. implementing these checks is left
21 to the developer of that application.
23 Further functionality is to be added here in later versions to provide easy
24 access to sessions, either through plugins or builtin methods.
28 =head2 generate_unique_id()
30 my $uid = Maypole::Session::generate_unique_id()
32 generates a unique id and returns it, requires no arguments but accepts size,
41 sub generate_unique_id {
42 my $length = shift || 32;
43 my $id = substr(Digest::MD5::md5_hex(Digest::MD5::md5_hex(time(). {}. rand(). $$)), 0, $length);
48 ################################################################################
49 ################################################################################
53 Currently implementing uniqueness tests of form submissions is left to the
54 Maypole user, we plan to provide an optional default behaviour to automate this
63 Aaron Trevena, c<teejay@droogs.org>
67 Simon Cozens, C<simon@cpan.org>
71 You may distribute this code under the same terms as Perl itself.