Maypole::Session(3)

πŸ“¦
version 2.13 Β· 2 versions
, in fedora 43

✨ Maypole::Session ✨

okay so bestie, welcome to Maypole::Session πŸ’– β€” this is the User Contributed Perl Documentation page for it, and it's literally the session-related functionality for Maypole. that's the whole vibe. πŸŽ€


🌸 NAME 🌸

Maypole::Session β€” session related functionality for maypole 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

use Maypole::Session;

my $uid = Maypole::Session::generate_unique_id()

like, that's it. that's the whole entry point rn. ✨


πŸ’œ DESCRIPTION πŸ’œ

so this class is the one that hands Maypole its session related methods β€” stuff like unique id's for requests. very demure, very mindful. πŸ‘‘

currently it provides only the generate_unique_id() function. and here's the lowkey genius part: by checking the id's generated by this function and included in submitted forms, it's possible to see if a form has been submitted before. πŸ•΅οΈβ™€οΈ

but fr fr β€” implementing these checks is left to the developer of that application. the module gives you the id, the actual checking is on you, bestie. no cap. 😭

further functionality is to be added here in later versions to provide easy access to sessions, either through plugins or builtin methods. so like... watch this space. 🌈


πŸ’… FUNCTIONS πŸ’…

πŸ“ generate_unique_id()

my $uid = Maypole::Session::generate_unique_id()

generates a unique id and returns it. that's the whole job description. πŸ’–

  • it requires no arguments β€” zero, nada, nothing, she's independent πŸ’…
  • but it does accept size
  • and the default is 32

so if you just call it bare, you get a 32-sized unique id. iconic behaviour honestly. ✨


🧚 TODO 🧚

currently, implementing uniqueness tests of form submissions is left to the Maypole user. which is to say β€” it's giving "you do it". πŸ™ˆ

but good news: they plan to provide an optional default behaviour to automate this if required. so one day it might just... happen for you. πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

  • Maypole

(the mothership. the origin story. go read her too.) 🌟


πŸ’– MAINTAINER πŸ’–

Aaron Trevena, c<teejay@droogs.org>


πŸŽ€ AUTHOR πŸŽ€

Simon Cozens, "simon@cpan.org"


🌸 LICENSE 🌸

You may distribute this code under the same terms as Perl itself. periodt. πŸ’…


okay and one lil sign-off because you deserve it: this page came to you from perl v5.42.0, dated 2025-07-25, and honestly? she ate. go generate some unique ids bestie, you got this πŸ’–βœ¨πŸ¦‹πŸŽ€

πŸ“¦ where this page comes from