write cookies using $.cookie since the read operation already tests it

Fixes #148