added support for cookies

I have added support for cookies.. please take a look!