[Dancer-users] Managing "sessions" for each open browser window

Damien Krotkine dkrotkine at gmail.com
Sat Sep 29 21:33:57 CEST 2012


This is really great ! Is it already on CPAN ? It's a very useful Plugin.

Le vendredi 28 septembre 2012 à 03:49, Assaf Gordon a écrit :

> Hello (yet again),
>  
> On 09/27/2012 11:15 AM, Assaf Gordon wrote:
> > Assaf Gordon wrote, On 09/24/2012 01:48 PM:
> > >  
> > > I want to maintain a "session" (i.e. collection of server-side variables) for each open browser window (not browser "session" in the technical sense).
>  
> I implemented such a mechanism as a Dancer Plugin: Dancer::Plugin::WindowSession .
>  
> See it in action here:
> http://winsid.cancan.cshl.edu/
>  
> The source code for the plugin (and the demo) are here:
> https://github.com/agordon/Dancer-Plugin-WindowSession
> (and soon in CPAN).
>  
>  
> On the Perl side, simply use "window_session" keyword instead of "session" keyword.
> On the template side, you'll need to pass along the "winsid" (=window session id) as a CGI parameter to every URL and POST request.
>  
> See code example here (that's the method that generates the plot for the demo):
> https://github.com/agordon/Dancer-Plugin-WindowSession/blob/master/eg/example/lib/window_session_test.pm#L28
>  
> It uses the same session mechanism defined in the config.yml, and only uses standard Dancer keywords (no ugly hacking),
> so I hope it will be stable and portable for Dancer2 .
>  
> Comments are welcomed,
> -gordon
>  
> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org (mailto:Dancer-users at perldancer.org)
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>  
>  


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120929/9cd5e04e/attachment.htm>


More information about the Dancer-users mailing list