Adding registration and setting cookie