Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dancer::session::cookie(3pm) [debian man page]

Dancer::Session::Cookie(3pm)				User Contributed Perl Documentation			      Dancer::Session::Cookie(3pm)

NAME
Dancer::Session::Cookie - Encrypted cookie-based session backend for Dancer SYNOPSIS
Your config.yml: session: "cookie" session_cookie_key: "this random key IS NOT very random" DESCRIPTION
This module implements a session engine for sessions stored entirely in cookies. Usually only session id is stored in cookies and the session data itself is saved in some external storage, e.g. database. This module allows one to avoid using external storage at all. Since server cannot trust any data returned by client in cookies, this module uses cryptography to ensure integrity and also secrecy. The data your application stores in sessions is completely protected from both tampering and analysis on the client-side. CONFIGURATION
The setting session should be set to "cookie" in order to use this session engine in a Dancer application. See Dancer::Config. A mandatory setting is needed as well: session_cookie_key, which should contain a random string of at least 16 characters (shorter keys are not cryptographically strong using AES in CBC mode). Here is an example configuration to use in your config.yml: session: "cookie" session_cookie_key: "kjsdf07234hjf0sdkflj12*&(@*jk" Compromising session_cookie_key will disclose session data to clients and proxies or eavesdroppers and will also allow tampering, for example session theft. So, your config.yml should be kept at least as secure as your database passwords or even more. Also, changing session_cookie_key will have an effect of immediate invalidation of all sessions issued with the old value of key. session_cookie_path can be used to control the path of the session cookie. The default is /. The global session_secure setting is honoured and a secure (https only) cookie will be used if set. DEPENDENCY
This module depends on Crypt::CBC, Crypt::Rijndael, String::CRC32, Storable and MIME::Base64. AUTHOR
This module has been written by Alex Kapranoff. SEE ALSO
See Dancer::Session for details about session usage in route handlers. See Plack::Middleware::Session::Cookie, Catalyst::Plugin::CookiedSession, "session" in Mojolicious::Controller for alternative implementation of this mechanism. COPYRIGHT
This module is copyright (c) 2009-2010 Alex Kapranoff <kappa@cpan.org>. LICENSE
This module is free software and is released under the same terms as Perl itself. perl v5.14.2 2011-12-20 Dancer::Session::Cookie(3pm)

Check Out this Related Man Page

Dancer::Template::TemplateToolkit(3pm)			User Contributed Perl Documentation		    Dancer::Template::TemplateToolkit(3pm)

NAME
Dancer::Template::TemplateToolkit - Template Toolkit wrapper for Dancer DESCRIPTION
This class is an interface between Dancer's template engine abstraction layer and the Template module. This template engine is recomended for production purposes, but depends on the Template module. In order to use this engine, use the template setting: template: template_toolkit This can be done in your config.yml file or directly in your app code with the set keyword. Note that by default, Dancer configures the Template::Toolkit engine to use <% %> brackets instead of its default [% %] brackets. This can be changed within your config file - for example: template: template_toolkit engines: template_toolkit: start_tag: '[%' stop_tag: '%]' You can also add any options you would normally add to the Template module's initialization. You could, for instance, enable saving the compiled templates: engines: template_toolkit: COMPILE_DIR: 'caches/templates' COMPILE_EXT: '.ttc' By default, Template is used, but you can configure Dancer to use a subclass with the "subclass" option. engines: template_toolkit: subclass: My::Template WRAPPER, META variables, SETs Dancer already provides a WRAPPER-like ability, which we call a "layout". The reason we do not use TT's WRAPPER (which also makes it incompatible with it) is because not all template systems support it. Actually, most don't. However, you might want to use it, and be able to define META variables and regular Template::Toolkit variables. These few steps will get you there: o Disable the layout in Dancer You can do this by simply commenting (or removing) the "layout" configuration in the config.yml file. o Use Template Toolkit template engine Change the configuration of the template to Template Toolkit: # in config.yml template: "template_toolkit" o Tell the Template Toolkit engine who's your wrapper # in config.yml # ... engines: template_toolkit: WRAPPER: layouts/main.tt Done! Everything will work fine out of the box, including variables and META variables. SEE ALSO
Dancer, Template AUTHOR
This module has been written by Alexis Sukrieh LICENSE
This module is free software and is released under the same terms as Perl itself. perl v5.14.2 2012-01-27 Dancer::Template::TemplateToolkit(3pm)
Man Page