fix bug about session expire condition