Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Same domain, different folder PHP session

Tags:

php

session

I want to set a different session ID depending on what folder a user is in.

For example, I have the domain https://example.com which has the folders /app1, /app2, etc. and then multiple files inside each app folder. I would like to set one session ID to be used with all files in app1 and a different session ID to be used in app2.

Can this be done?

like image 497
Kere Puki Avatar asked Mar 29 '11 22:03

Kere Puki


1 Answers

Set the path in the session cookie with session_set_cookie_params. Before session_start of course.

like image 121
Wrikken Avatar answered Nov 11 '22 02:11

Wrikken