Refactor session ID regeneration