add $view as parameter for session constructor