Dancer::Plugin::WindowSession Example

## Per-Window Session Variables (unique to each open browser window/tab) ##
window_session = $VAR1 = bless( {
'id' => '218343964465928640572411864203040728'
}, 'Dancer::Session::YAML' );
## Per-Session Variables (shared between all open browser windows/tabs) ## session = $VAR1 = bless( {
'id' => '827960743411241493494980603052780737',
'username' => 'New User'
}, 'Dancer::Session::YAML' );

Hello New User

Here's your chart:

Change Image Settings Open a new Browser Window

What is this good for?

Use this Dancer module if you need to maintain independent state variables for each open browser window (as opposed to the more standard state variables for each browser session, i.e. all open browser windows share the same state).

Try it out

  1. Click the "Change Settings" (blue button). Change the plot settings as you wish, click "save settings" to redraw the plot.
  2. Click the "open new browser window" (red button) - a new browser window/tab will be open, with the plot settings back to default.
  3. View the two open browser windows side-by-side (this is the whole point of this module).
  4. Click the "Change settings" (blue button) on either (or both) of the open windows, and change the plot settings.
  5. Each window maintain an independent set of state variables (plot color,type,size).
  6. Only the username variable is shared between the open windows
  7. Click "show template variables" (cyan button) to view Dancer's session and window_session variables

Is this really needed?

More information

Contact: gordon at cshl dot edu