You need to use cookies . I here once answered about the session.
In cookies, you can specify a lifetime, when creating a variable, and the browser will store data all the time, or until you delete it. But, you have to protect such data, and in no case should you pass authentication data or personal / secret data into the cookie, as This data is transmitted to the client, and can be read.
If you set the cook life time to 0, they will be session time, i.e. will be erased after closing the browser. As the same SESSID , which is overwritten, and after opening the page again, is not sent to the server, so PHP cannot allocate the old session and creates a new one.