Add support for environments without res.cookie

fixes #19