registring user and setting cookies done