checking for empty sessions and redirecting back to login form