[cgiapp] Problem with Flash, Session & persistent environment identified

Richard Jones ra.jones at dpw.clara.co.uk
Fri Nov 21 15:11:53 EST 2008


Ron Savage wrote:
> Hi Richard
> 
> On Fri, 2008-11-21 at 12:05 +0000, Richard Jones wrote:
>> If Ron can make a working demo with CAP::Flash :) ..
> 
> Go on, say it! If he can, anyone can!

Heh! Of course I didn't mean it that way, but it inspired me to do the same.

>> Starting out with the bare minimum (no login, no authentication, direct 
>> use of $dbh, etc), I get the flash messages displaying under mod_cgi, 
>> but not under CA::Server unless I session->flush in teardown.
>>
>> use base qw(Titanium);
>> use CGI::Application::Plugin::TT;
>> use CGI::Application::Plugin::Flash;
>>
>> Startmode() sets some flash messages then re-directs to function1() to 
>> display the template.
>>
>> Removing Titanium and substituting CGI::Application as the superclass 
>> was the key to getting the flash messages displayed under CA::Server 
>> without needing session->flush. Yay!!
>>
>> Then, bringing back all the plugins that Titanium uses one by one until 
>> it broke again, CAP::ErrorPage is the one responsible. Presumably there 
>> is something in there that causes the session to be retained in a 
>> persistent env?
> 
> Nice piece of detective work. Well done.

With the invaluable help of a number of kind folk on this list, and 
Devel::Cycle. Otherwise I'd probably still be staring blankly at it in 
years to come :)
-- 
Richard Jones


More information about the cgiapp mailing list