Cookies are objects that we use to store some information of the user in the browser like geolocation of user . It is a set of key value pair. All cookies have time of expiry after which they are just deleted from the browser usually at the end of the browsing session. The most common use of cookie is storing the user session_id after login in a website. In rails we can get to the cookie using a special hash called cookie.
cookie[:country] = India #writing a cookie
cookie[:country] #=> India #reading a cookie
cookie.delete(:country) #deleting a cookie