<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Regarding session expiring, I am having a little problem.<br><br>I want to redirecto to login page whenever session is expired. It works allright, but when I do the redirect in a Controller index method ( sub index :Path :Args(0){} ), I always get next error message:<br><br>Caught exception in engine "Can't call method "as_string" on an undefined value at /usr/local/share/perl/5.8.8/Catalyst/Engine.pm line 95."<br>Browser gets 404 HTTP Error, because instead of being redirect to login page, it is redirect to the same page, the page which is served int the index method.<br><br>I have made tests, and the redirect doesn't seem to be working right in this case. Code is executed after redirect, instead of stopping executing.<br><br>Redirect looks like:
 $c-&gt;response-&gt;redirect($c-&gt;uri_for('/'));<br><br><div>&nbsp;</div>David<div><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">De:</span></b> Ben Hitz &lt;hitz@genome.stanford.edu&gt;<br><b><span style="font-weight: bold;">Para:</span></b> The elegant MVC web framework &lt;catalyst@lists.scsys.co.uk&gt;<br><b><span style="font-weight: bold;">Enviado:</span></b> jue,15 abril, 2010 18:59<br><b><span style="font-weight: bold;">Asunto:</span></b> Re: [Catalyst] Check is session is expired<br></font><br> $c-&gt;session-&gt;session_expires) returns 0 when the session is expired (and deletes the session).<br><br>Caveat: I am brand new - never installed the sw, but I was JUST reading this in the docs.<br><br>Ben<br><br>On Apr 15, 2010, at 8:33 AM, David
 wrote:<br><br>&gt; Hi,<br>&gt; <br>&gt; Is there any method in order to check if user session has expired, so that user is redirect to login page?<br>&gt; Something like $c-&gt;session-&gt;is_expired which returns true or false?<br>&gt; <br>&gt; I've checked Catalyst Session Plugin, but I havem't found any method to check if session has expired.<br>&gt; <br>&gt; David<br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>&gt; Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>&gt; Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>&gt; Dev site: <a
 href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br><br>--<br>Ben Hitz<br>Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium<br>Stanford University ** <a ymailto="mailto:hitz@genome.stanford.edu" href="mailto:hitz@genome.stanford.edu">hitz@genome.stanford.edu</a><br><br><br><br><br>_______________________________________________<br>List: <a ymailto="mailto:Catalyst@lists.scsys.co.uk" href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>Dev site: <a href="http://dev.catalyst.perl.org/"
 target="_blank">http://dev.catalyst.perl.org/</a><br></div></div>
</div><br>



      </body></html>