Hi.all;

I have a Dancer2 application for which I use the YAML session engine. Its purpose is to provide a simple GUI for certain system administration tasks at $work. The app is constructed so that the user first encounters a login page where he can enter his username and password, and the name of the server he wants to work on, and if the credentials are correct, the app displays the state of the various services running on the server and the actions available on them. (I'm deliberately vague here - the details are not really important.)

I use (abuse?) Dancer2's session mechanism to store all the relevant data from the server the user working on - and here is my problem. Dancer2's sessions are, in effect, per browser. So if the user opens my app on a browser tab, logs in to one server, then opens a second tab and attempts to log in to a different server, it won't work, because (at best) it will display the data from the existing session, or (at worst) behave in a confusing, incorrect way.

Is it possible to make the sessions per window (or more properly, per browser tab)? The closest example I've found is Dancer::Plugin::WindowSession, but that's an abandoned module for Dancer 1, apparently not ported to Dancer2.


In reply to Dancer2 per-window sessions? by kikuchiyo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.