how to write cookies from webpage?