[cgiapp] CAP::Authentication not working properly with CAP::Session

Ron Savage ron at savage.net.au
Thu Nov 20 20:00:59 EST 2008


Hi Richard

Aaaahhhhh.

I just wrote a small demo.

> >> I get the impression only 1 'get' call to the session flash is 
> >> permitted, after that it's cleared. So for example this doesn't work:
> >>
> >> [% FOREACH type IN [ 'INFO', 'WARNING', 'ERROR' ] %]
> >>   [% IF c.flash.has_key(type) %]
> >>     <p>[% c.flash.get(type) %]</p>, etc
> >>
> >> Only the first 'type' (INFO in this case) gets printed, even though in 
> >> a test script I put all 3 in.
> > 
> > That should work.  You should be able to call get() as many times as you 
> > want.  It does not change the data in any way.  If you put [% 
> > c.flash.dump %] in your template, does it show all the correct data?
> 
> It does. If I put it above the FOREACH block, it stops any flash 
> messages appearing in the FOREACH block. But if I put it underneath the 
> FOREACH block then I get output from both. And if I put it above and 
> below, I only get output from the top one. It's making my head hurt!

It works perfectly for me, and guess what?

I not (that's NOT) using TT. I'm using HTML::Template.

I call $flash -> dump() before and after calling has_key(...) and
get(...) in a loop (since I tested with 2 keys), and the output is
perfect.


-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html




More information about the cgiapp mailing list