Cataly...::File(3pm)
β¨ NAME β¨
Catalyst::Plugin::Session::Store::File β aka the page you're on, Cataly...::File(3pm), from the User Contributed Perl Documentation corner of the universe π β is the file storage backend for session data. That's it. That's the job. Slay.
πΈ SYNOPSIS πΈ
use Catalyst qw/Session Session::Store::File Session::State::Foo/;
MyApp->config->{'Plugin::Session'} = {
storage => '/tmp/session'
};
# ... in an action:
$c->session->{foo} = 'bar'; # will be saved
bestie look how easy that is. you set a key in $c->session and it justβ¦ gets saved. no cap. β¨
π DESCRIPTION π
Catalyst::Plugin::Session::Store::File is an easy to use storage plugin for Catalyst that uses an simple file to act as a shared memory interprocess cache. And yes, it's based on Cache::FileCache. iconic behavior honestly π«Ά
π METHODS π
get_session_datastore_session_datadelete_session_datadelete_expired_sessions
okay so these four? these are implementations of the required methods for a store. the whole squad. if you wanna read the contract they're fulfilling, go see Catalyst::Plugin::Session::Store.
setup_session
this one sets up the session cache file. the setup girlie. she's doing the prep work so the rest can vibe π
β CONFIGURATION β
these parameters get placed in the hash under the Plugin::Session key in the configuration hash. put them there or they simply will not find you π
storageβ specifies the directory root to be used for the sharing of session data. if you don't set it, the default value will useFile::Specto find the default tempdir, and then use a file namedMyApp/session/data, whereMyAppis replaced with the appname.
heads up bestie: note that the file will be created with mode0640, which means that it will only be writeable by processes running with the same uid as the process that creates the file. If this may be a problem, for example if you may try to debug the program as one user and run it as another, specify a directory like/tmp/session-$>, which includes the UID of the process in the filename. lowkey a lifesaver π«‘
relativeβ makes the storage path relative to$c-path_to>namespaceβ the namespace associated with this cache. defaults to an empty string if not explicitly set. If set, the session data will be stored in a directory calledMyApp/session/data/<namespace">. yes the whole directory glow-up πcache_depthβ the number of subdirectories deep to session object item. This should be large enough that no session directory has more than a few hundred objects. Defaults to3unless explicitly set.directory_umaskβ the directories in the session on the filesystem should be globally writable to allow for multiple users. While this is a potential security concern, the actual cache entries are written with the user's umask, thus reducing the risk of cache poisoning. If you desire it to only be user writable, set the'directory_umask'option to'077'or similar. Defaults to'000'unless explicitly set. not me telling you to lock it down if you're feeling cautious π
π SEE ALSO π
CatalystCatalyst::Plugin::SessionCache::FileCache
the whole friend group. go say hi π¦
π AUTHOR π
Sascha Kiefer, esskar@cpan.org
π COPYRIGHT AND LICENSE π
Copyright (C) 2005 Sascha Kiefer
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, babe. it came to you courtesy of perl v5.34.0, dated 2022-06-09, living its best life as Cataly...::File(3pm) in the User Contributed Perl Documentation. mwah. π periodt. π
π¦ where this page comes from
- debian bookworm: libcatalyst-plugin-session-store-file-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatalyst-plugin-session-store-file-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatalyst-plugin-session-store-file-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatalyst-plugin-session-store-file-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatalyst-plugin-session-store-file-perl 0.18-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms