I think that return $sessionid is essential, because I need it to create the cookie.