Set cookie
call cookie::set $name=...;$val=...[;$path=...] [;$expire=time in seconds] [;$force_current=1 or 0]

Get cookie
[assign $var=]call cookie::get $name=...[;$default=...]
$default = The value to use if the cookie does not exist

Delete cookie
call cookie::delete $name=...[;$path=...] [;$force_current=1 or 0]

$path=A relative path to the page or folder allowed to use the cookie

You cannot set $domain for security reasons.
Also after setting cookie a page refresh should be made to access that cookie. 
It's just how cookies works. 
To overcome this behavior and access the cookie instantly you can add $force_current=1 parameter to the cookie::set but be really careful about this