Replacing sessions to avoid duplicates