That's pretty cool, rebelo. It's similar to what I suggested, with the exception of the timeout. In jonsof's case, I suggest creating the cookie with the session_id, and always checking the cookie before accessing the session. He should create a session cookie (no timeout specified), so that when the browser is closed, the cookie dies. When the browser opens, the cookie is found to be missing when hitting the page, and the old session is closed, and a new session created. I think this is the functionality jonsof is looking for...
However, in this case, it seems a little redundant to create a session variable. If you want variables that are persistent, but die upon closing the browser, simply create cookies for those variables. Wouldn't that do what you wanted to do, jonsof? Or am I missing something?