views:

43

answers:

0

I am using zend framework v1.9.6 and written a piece of code in preDispatch method of one of the controllers as

if(!isset($_SESSION['myvar']){
    //do something and assign a value to the session variable
} 

..so that the code executes only once.

However I am getting a fatal error at the end of the page everytime except for when the application is loaded for the first time

Fatal Error:Exception thrown without a stack frame in Unknown on line 0

when the above code is commented out,the error disappears. Also when the if statement is commented out and the code is allowed to execute every time, the error disappears.

the code inside the condition does get executed which i found out by setting a variable $this->view->myvar = 'hello world' and accessing it in the view.

I am unable to figure out how to spot the error and interestingly, the execution doesnt terminate even though the error is a fatal error.

Please help.