Also save and restore the session cookie-parameter

Unless owncloud/lib/base.php may "damage" them (i.e. it uses its own
setttings).