Implemented session id regeneration, and last action check