Casting id member in setLoginCookie and fixed the cookie validation regexp accordingly

Signed-off-by: emanuele <emanuele45@gmail.com>