I have developed a small administration page for game servers which you can add/remove/edit settings online.
Everything works fine, but I have problem with sessions. If the log in is successful the session ID is created
$_SESSION['adm_login'] = "okay";
If I visit another page, the same platform (on the same web server) the session is automatically created. This happens only if I log in successful to my web page.
I think this problem happens because everything is on the same web server, because the session ID’s are same.
What should I do? Am I need to create a table in data base where I store session ID’s or… ?
Can anyone give me an example, or a tutorial for sessions php.
Thank you !
Use settings such as
session.cookie_pathorsession.cookie_domainso that the session cookie is only valid for the path or domain you want it to be.For instance, if you have one folder for each “project”, you would set
session.cookie_pathto the current project folder. This will ensure the browser only sends the session cookie for that project, and not for other ones. A new session will be generated for each project the user visits.