Fixed cookie handeling