If cookies are disabled in a browser, can we create a non persistent cookie which will get destroyed when the browser is closed?
No. What the browsers do with your cookie is up to them. You can only offer them one, not dictate what they do with it.
My browser is set up to ask me if I want to accept cookies, and if I want to I can override their expiration to browser exit.
Persistent cookies are permanent cookies.They are stored as a text file in the hard disk of the computer.
Non-persistent cookies are stored in browser processor in temporarily. Its also called in memory cookies. Non-Persistent cookies are otherwise called as temporary cookies.They are active as long as the browser remains active.They are also called as session based cookies.Once the browser is closed the cookies vanishes automatically.
Non-persistent cookies are cookies in any way. So if cookies are disabled, it includes disabling all types of cookies i.e locking the browser out of writing any data to the main memory or the file system.
However if you wish to store session information you can use cookie less sessions, which obviously use the alternative of adding a session key to the address.