<!DOCTYPE html>
<html lang="en">
<head>
    <title><% $r->headers_in->get('X-Forwarded-Host') or $r->hostname() or 'No host' |h %> - <% $session{_session_id} or 'no cookie' %></title>
    <meta charset="utf-8">
    <link rel="shortcut icon" href="/favicon.ico" />
</head>
<body>
    <h1>Session <a href="<% $r->uri %>" title="Refresh">&#x27f3;</a></h1>
    <hr />

<pre>
%   foreach my $key (sort(keys(%session))) {
%       $m->out('<a href="?action=delete&key='.$m->interp->apply_escapes($key, 'u').'" title="Remove">×</a> ') if ($key !~ m/^_/ or $key eq '_login');
%       $m->out(Data::Dumper->Dump([$session{$key}], ['$session{'.$key.'}']), "\n");
%   }
</pre>

    <hr />
    <form action="?action=add" method="post">
        Add key <input type="text" name="key" /> with value <input type="text" name="value" /> <input type="submit" value="Add" />
    </form>

    <hr />
    <address>Doloforge - &copy; 2006-2018 Dolom&egrave;de</address>
</body>
</html>

<%doc>
    WARNING : rename this file to _session.phtml if you don't want it to be used on production projects
    The skeleton file is named without the leading "_", so that when you remove/rename it on devl,
    the publishing process will propagate the change to test and prod.
    If the file was named "_session.phtml" in the skeleton, it would exist on test and prod right from
    the project creation, and it would be impossible to remove it when publishing, thanks to excludes...
</%doc>

<%flags>
    inherit => undef
</%flags>

<%args>
    $action => undef
    $key => undef
    $value => undef
</%args>

<%init>
    if ($action eq 'delete') {
        delete $session{$key};
    } elsif ($action eq 'add') {
        $session{$key} = $value;
    }
    local $Data::Dumper::Sortkeys = 1;
    local $Data::Dumper::Indent = 1;
    local $Data::Dumper::Quotekeys = 0;
</%init>
