turn session into hash before reset due to both sessions being reset (old and new)

We found that both the existing session and the new session get reset when duping. By converting it to a hash before resetting we don't run into the same problem.

Hats off to @mvandenbeuken for finding the bug & the fix.