Added a try/except statement to catch session['logged_in'] errors.