Added support for multiple cookies, fixed databade bug