added support for cookie, ref #81