I use the following code in the two php include file to switch between sessions(and website areas):
php include file 1
Expand|Select|Wrap|Line Numbers
- <?php
- session_id('reg-gen');
- session_start();
- session_destroy();
- session_id('assess');
- session_set_cookie_params(0);
- session_start();
- and the rest of the code ................
- AND php include file 2
- <?php
- session_id('assess');
- session_start();
- session_destroy();
- session_id('reg-gen');
- session_set_cookie_params(0);
- session_start();
- rest of the code..............................
When I close the browser and try to access a page in the same area of the web site as previously (with the same phpinlude file) I am not asked to login.
I tried adding:
Expand|Select|Wrap|Line Numbers
- session_start();
- session_destroy();
How can I destroy the previous session when leaving the browser, but only need to log in once on the first page instance of the same site area?