NAME Dancer::Plugin::WindowSession - Manage Per-Browser-Window sessions. VERSION version 0.2.1 SYNOPSIS use Dancer; use Dancer::Plugin::WindowSession; get '/' => sub { ## Read Session-wide variable ## (applies to all open browser windows) my $username = session 'username'; ## Read Window-Session variable ## (will be different for every open browser window) my $color = window_session 'color'; ## [ return something to the user ] }; ## Assume the user submitted a POST
FUNCTIONS `window_session' - Read/Write access to the per-window-session variables. Behaves exactly like Dancer's `session' keyword. `window_session_id' - Returns the per-window-session ID number (if you need to embed it in a URL string). DESCRIPTION This module makes it easy to manage per-window session variables (as opposed to browser-wide session variables). The common use case is when you expect users of your website to have multiple web-browser windows open with your web-site, and for each open window you want to maintain independant set of variables. IMPLEMENTATION To use this plugin effectively, be sure to include the `winsid' value in all URLs and POST forms you have in your templates. This plugin uses the same session engine configured for your Dancer application (see Dancer::Session). CONFIGURATION No configuration options are available, at the moment. Future version might allow changing the name of the CGI varaible (`winsid') to something else. AUTHOR Assaf Gordon, `