Make session stashing work on the same request. Closes #1535.