fixes #6: save session variables correctly