class myController extends Controller
{
public function newAction($id)
{
$session = $this->get('session');
if(is_null(($session->get('foo')))){
echo "the variable foo is no set in session";
$session->set('foo', 'bar');
}
}
}
Why the msg of the echo appears every time the action is load?
var_dump($session->isStarted())? Iffalse, try$session->start(). Iftrue, check your browser settings!