Not necessarily. Try replacing with a call to isStarted() for example.

You can have a session started, but not immediately existing (i.e. detected)
for the current page. It is normal to require at least one additional
request for a session existence check to be detectable. 

You have to bear in mind what existence means - that the client has a cookie
or has passed an SID via other means. Obviously the current page setting
those values, needs another request so the browser can notify it if these
are set via $_COOKIE or $_REQUEST (GET|POST).

Paddy


JARUZ wrote:
> 
> Sample code:
> 
>           Zend_Session::start();
>           if( Zend_Session::sessionExists() ) {
>               echo 'Session exists';       
>           }
>           else {
>               echo 'Session does not exist';   
>           }
> 
> Will output "Session does not exist" for the FIRST request to the page.
> Subsequent calls to the page work fine.
> 
> Clearly since the session was started, sessionExists() should return true
> even the first time. Right?
> 
> Cheers,
> 
> 
> Antonio
> 


-----
Pádraic Brady

http://blog.astrumfutura.com
http://www.patternsforphp.com
OpenID Europe Foundation - Irish Representative
-- 
View this message in context: 
http://www.nabble.com/Possible-bug-with-sessionExists%28%29---tp17405075p17405278.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to