[dancer-users] New session on reload using Apache CGI

mark jones mjemail at me.com
Sun Feb 14 13:02:56 GMT 2016


Hi,

I was just doing some testing deploying a Dancer2 app under Apache using CGI.  For some reason I get a new session each time the page reloads, does anyone know why?  It works fine with plackup.  I am using AMPPS so it could just be something screwy with my config.

Dancer App2 snippet

get ‘/' => sub {
	session Name => ‘foo’;
	Dumper(session);
};

 get ‘/name' => sub {
 	return session('Name');
 };

Apache conf

<VirtualHost *:80>
        ServerName localhost
        DocumentRoot "/testing"
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f

        <Directory “/testing">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
            AddHandler cgi-script .cgi
        </Directory>
        RewriteRule /App2(.*)$ /App2/public/dispatch.cgi$1 [QSA,L]
</VirtualHost>

Cheers

Mark


More information about the dancer-users mailing list