Store session variables when using "Save As" function.

Fixes issue #114.