Fix a bug when session id is expired