a method for cookie usage