Fixed cookie bug.

Fixed bug to properly enable/disable cookie reading/writing.