Added cookies method.

Improved cookie method. Fixed #3.