Apache...formix(3pm)

πŸ’Ύ Apache::Session::Store::Informix(3pm) β€” bestie edition 🫢

okay so this is a page from the User Contributed Perl Documentation, and it's all about Apache::Session::Store::Informix. sit down, hydrate, let's get into it πŸ’…


✨ NAME ✨

Apache::Session::Store::Informix β€” the module that stores your persistent data in an Informix database. no cap, that's literally its whole job πŸŽ€


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste energy:

use Apache::Session::Store::Informix;

my $store = new Apache::Session::Store::Informix;

$store->insert($ref);
$store->update($ref);
$store->materialize($ref);
$store->remove($ref);

four little method calls, and your sessions are living their best life in a database πŸ”₯


πŸ¦‹ DESCRIPTION πŸ¦‹

Apache::Session::Store::Informix fulfills the storage interface of Apache::Session. that's the whole flex. your session data gets stored in an Informix database, and the module handles all the storage-interface obligations like the icon it is πŸ‘‘


πŸ’œ SCHEMA πŸ’œ

so to actually use this module, bestie, you're gonna need at least these columns in a table called sessions:

id char(32)     # or however long your session IDs are.
a_session lvarchar

and to create that schema, you can execute this command using the sqlplus program:

CREATE TABLE sessions (
   id char(32) not null primary key,
   a_session lvarchar
);
⚠️ if you use some other command instead, ensure that there is a unique index on the table's id column. don't skip this, it's giving consequences πŸ™ˆ

🌈 CONFIGURATION 🌈

the module must know what datasource, username, and password to use when connecting to the database. these values can be set using the options hash (see the Apache::Session documentation, iykyk). the options are DataSource, UserName, and Password.

example, because we love a demo:

tie %hash, 'Apache::Session::Informix', $id, {
    DataSource => 'dbi:Informix:database',
    UserName   => 'database_user',
    Password   => 'K00l'
};

instead, you may pass in an already-opened DBI handle to your database. very main character of you:

tie %hash, 'Apache::Session::Informix', $id, {
    Handle => $dbh
};

and the last option is LongReadLen, which specifies the maximum size of the session object. if it's not supplied, the default maximum size is 8 KB. periodt.


πŸ’– AUTHOR πŸ’–

this module was written by Mike Langen <mike.langen@tamedia.ch>, based on the original for Oracle. shoutout to the source material fr fr 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

  • Apache::Session
  • Apache::Session::Store::DBI

go read those too, they're iconic, no notes ⭐


and that's the whole page, bestie!! this was shipped as part of perl v5.36.0, dated 2022-11-19, and the manual is Apache::Session::Store::Informix(3pm) under User Contributed Perl Documentation. stay slaying, keep your sessions persistent, and go touch some grass πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from