Dancer2...n::YAML(3)

πŸ’– NAME πŸ’–

Dancer2::Session::YAML β€” it's giving YAML-file-based session backend for Dancer2 ✨ (and yes bestie, that's the whole name, she's long but she's worth it)

Oh also? This page lives in the User Contributed Perl Documentation section, manual section 3, so like… third-party module docs, iykyk πŸŽ€


🌸 VERSION 🌸

version 2.2.1 β€” that's the one, no cap πŸ’…


✨ DESCRIPTION ✨

Okay so bestie, listen. This module is a session engine that runs on YAML files. Your sessions get stored in a session_dir as YAML files, one per session, sitting there like little readable text babies πŸ₯Ί

The whole idea behind this module? Human-readable session storage for the developer. That's it, that's the vibe. You wanna peek inside a session and actually read it like a person instead of decoding binary goop? That's the dream this module is serving. πŸ‘‘

This backend is intended to be used in development environments, specifically for when digging inside a session is useful. Which is, like, all the time when you're debugging, fr fr πŸ”

Now, can it be used in production? Yes, absolutely, this backend can perfectly be used in production environments β€” but bestie, keep TWO things in mind and don't skip this part: 1. The content of the session files is in plain text. Like, plain. Text. Anyone with file access can read it. πŸ’€ 2. The session files should be purged by a CRON job. They do not clean themselves up, they are not self-maintaining, they will pile up like unread notifications. Set up that CRON, bestie. πŸ™ˆ

πŸŽ€ CONFIGURATION πŸŽ€

First things first: you gotta set the setting session to "YAML" so your Dancer2 app knows to use this engine. That's the entry fee, no exceptions. πŸ’Έ

Then, the files get stored to whatever you put in the setting session_dir. Its default value is:

appdir/sessions

Here's an example configuration that uses this session engine and stores session files in /tmp/dancer-sessions β€” copy it, love it, make it yours 🫢

session: "YAML"

engines:
  session:
    YAML:
      session_dir: "/tmp/dancer-sessions"
      cookie_duration: 3600    # Default cookie timeout in seconds

Look at that. Beautiful. Organized. Iconic. ✨


πŸ¦‹ DEPENDENCY πŸ¦‹

This module depends on YAML. That's it. Just YAML. Make sure it's installed or nothing's gonna work and we'll both be sad 😭


🌈 SEE ALSO 🌈

Wanna know the details about session usage in route handlers? Go read Dancer2::Core::Session β€” she's the one with the lore, bestie πŸ“–


πŸ‘‘ AUTHOR πŸ‘‘

Dancer Core Developers β€” legends, honestly, we stan πŸ’œ


This software is copyright (c) 2026 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. πŸͺ


and that's the whole page, bestie!! this was documented with perl v5.42.3 on 2026-09-20 β€” mwah, go write some readable sessions, slay, periodt πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from