I'm not sure that I understood the problem correctly, but you can try checking the path to see if it will be in app1, app2, etc., then get a part of the line you are interested in and use it to establish a session, for example, using $_SERVER['REQUEST_URI'] or $_SERVER['SCRIPT_NAME'] .
If you already do this, and your problem is that it just won't establish a session?
source share