add spec for cookie
add write cookie method. add additional test