Pass cookie through programmatic API #41

Fixes #41