fixed automatic logout for expired sessions