Sympa::WWW::Session(3Sympa)
π Sympa::WWW::Session π
okay bestie, sit down, hydrate, and let's talk about Sympa::WWW::Session from the 3Sympa manual β it's the Web session module, and it's basically the backstage pass that keeps track of who's who in the Sympa web interface. π
β¨ NAME β¨
Sympa::WWW::Session β Web session. periodt.
πΈ SYNOPSIS πΈ
use Sympa::WWW::Session;
my $session = Sympa::WWW::Session->new($robot,
{cookie => Sympa::WWW::Session::get_session_cookie($ENV{'HTTP_COOKIE'})}
);
$session->renew();
$session->store();
π Confirmation
$session->confirm_action($action, 'init');
sub do_myaction {
# Validate arguments...
$param->{arg} = $arg;
my $next_action = $session->confirm_action($action, $response,
$arg, $previous_action);
return $next_action unless $next_action eq '1';
# Process action...
}
π¦ DESCRIPTION π¦
Sympa::WWW::Session hands you a web session for the Sympa web interface, no cap. You need an HTTP cookie to figure out who the user even is (like, it's the whole basis of identification, fr fr), and a session store is what keeps hold of people's personal data. π₯
π Methods
new ( $robot, { [ cookie => $cookie ], ... } )β Constructor. It makes a brand-new instance and pulls the user's data out of the session store. β¨- Parameters:
$robotβ the context of the session.{ cookie => $cookie }β the HTTP cookie.
- Returns: a new instance. π«Ά
- Parameters:
as_hashref ( )β Instance method. It casts the instance into a hashref, iconic behaviour honestly.- Parameters: none.
- Returns: a hashref including the attributes of the instance (peep "Attributes").
confirm_action ( $action, $response, [ arg => $arg, ] [ previous_action => $previous_action ] )β Instance method. It checks whether an action has actually been confirmed. π
Confirmation happens in two steps:
- You call the method with no response (aka undefined). The action, the hash of the argument, and the
previous_actionall get stored into the session store. Then this method returns'confirm_action'. - You call the method with
'confirm'or some other true value as the response. If the action and the hash of the argument match what's in the session store, then:- If
'confirm'was given, it returns1. - If some other true value was given, it returns the previous action stored in the session store (and the
previous_actionyou passed in the argument gets ignored, sorry bestie). In both cases the session store gets cleared. π
- If
Anytime the action submitted by the user has been determined, this method may be called with the response as 'init'. In that case, if the action doesn't match the one in the session store, the session store will be cleared.
- Parameters:
$actionβ the action to be checked.$responseβ response from the user:'init', a false value (not yet checked),'confirm', and others (cancelled). This is typically given by the user through the"response_action"parameter.arg => $argβ the argument(s) of the action.previous_action => $previous_actionβ the action users will be redirected to when the action is confirmed. This is typically given by the user through the"previous_action"parameter.
is_anonymous ( )β Instance method. TBD. π (yes, that's all it says, we simply don't know yet)renew ( )β Instance method. It renews the session: updates the internal session ID and the HTTP cookie. fresh start energy β¨store ( )β Instance method. Stores the session into the session store.
π§ Functions
check_cookie_extern ( )β Function. Deprecated. πdecrypt_session_id ( )β Function. Deprecated. πencrypt_session_id ( )β Function. Deprecated. πlist_sessions ( )β Function. TBD.purge_old_sessions ( )β Function. Deprecated. πset_cookie ( $cookie_domain, $expires, [ $use_ssl ] )β Instance method. TBD.set_cookie_extern ( $cookie_domain, [ $use_ssl ] )β Instance method. Deprecated. π
lowkey a lot of "Deprecated" up in here β if you're reaching for one of those, maybe don't? it's giving legacy. π
β Attributes
TBD. π
πΈ SEE ALSO πΈ
Sympa::DatabaseManager.
π HISTORY π
SympaSession showed up way back on Sympa 5.4a3. β¨
Then it got renamed to Sympa::Session on Sympa 6.2a.41, and after that to Sympa::WWW::Session on Sympa 6.2.26. glow-up after glow-up honestly. π
The "confirm_action" method was added on Sympa 6.2.17.
and that's the whole page, bestie!! this was version 6.2.80, dated 2026-10-19, straight from Sympa::WWW::Session(3Sympa). mwah, take care of your sessions π«Άπ
π¦ where this page comes from
- fedora 43: sympa-devel-doc 6.2.80-2.fc43 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- fedora 44: sympa-devel-doc 6.2.80-2.fc44 Β· GPL-2.0-or-later AND (OFL-1.1-RFN AND MIT) AND OFL-1.1-RFN AND MIT and (MIT OR GPL-2.0-only)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms