Fixed the bug: Session event is not always stored in local storage