How a way it is much secure & good way.
A user may pass the link to your website to someone else. If the session id is stored in the query string, it may also be passed on by a naive or careless user. This cannot happen with cookies.
The negative aspect to cookies is that, while most users have cookies enabled, some choose to disable that feature. And In this regard what we can give solution.
Require that your users have cookies enabled, at least for your website, and inform them that the cookie will only be used for user authentication. The alternative is to risk naive or careless users handing out their session ids.
My problem is how to destroy this field when browser crashes/closed.
You cannot determine the precise moment when the user closes the browser, walks away from the computer, or has his/her computer destroyed by a thermonuclear bomb. You can only determine the moment when the user uses your script's log out functionality.
This is why I suggest that you record the time of the last page load: you can arbitrarily decide that if the user has not loaded the page in the past x minutes, the user has probably closed the browser, walked away from the computer, etc.