How can we make cookies to exist even when we close browser?
Cookies could be given a lifetime when we declare them. We could use cookie.setMaxAge(int) where is in seconds. when we set it to -1 the cookie disappears when we close the browser. A zero value causes the cookie to be deleted.
And about your question when the same cookie could be used by two browsers at same time from the same machine is YES. The cookies are stored in a particular location in your computer and with the name of the URL generally. When you open an URL it first looks whether there is any cookie associated with the particular URL and sends it with the request. You can even come after sometime and see that the cookie is still alive.
A browser is expected to support 20 cookies for each webserver, 300 cookies total and may limit the size to 4kb each.
Hope this helps.
Thanks
Chandu