This commit fix #78 and fix a bug in #77

Implements support to Init cookie on server side

Signed-off-by: Ivo Calado <txithihausen@gmail.com>
Signed-off-by: João Correia <lucaskm98@gmail.com>