Fixed session authentication

Now the user can only access internal pages if they are logged in.