Hello Andy,
Something like
$c->session->{"paidup"} = “DEFAULT_VALUE";
Should work just fine.
You should then be able to access it using:
my $custom_value = $c->session->{"paidup"};
The stash is mainly used to pass values to the “view"
Cheers!
dw.
—
Derek Wuelfrath
[email protected] :: +1.514.447.4918 (x110) :: +1.866.353.6153 (x110)
Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence
(www.packetfence.org)
> On Oct 22, 2015, at 8:16 AM, Andy A <[email protected]> wrote:
>
> Hi.
>
> I would like to set a session variable called 'paidup' on login.html in the
> captive portal and access it's value on release.html page.
>
> I have seen there's a lib/pf/web/custom.pm where I can add the session
> variable.
>
> pf::web::stash_template_vars = sub {
> my ($portalSession, $template) = @_;
> return { 'paidup' => DEFAULT_VALUE };
> };
>
> Then, in login.html I can set it to a value based on user input and in
> release.html I can access it?
> Is that the best way to do it or is there any other better way?
>
> Thanks
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> PacketFence-users mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/packetfence-users
> <https://lists.sourceforge.net/lists/listinfo/packetfence-users>
------------------------------------------------------------------------------
_______________________________________________
PacketFence-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/packetfence-users