0

Let's say I have www.example.com for hosting multiple PHP projects that completely unrelated e.g. www.example.com/app1 , www.example.com/app2. Every projects mades by different person so app1 owner cannot modify app2 project.

The problem is when app1 login/logout , it affects on app2. So, How do I separate a session for different project ? or I need to set a root path at somewhere...

Now my project has only

session_start();

at the top of every page.

P.S. Sorry for bad English.

  • if you really want to separate them see http://stackoverflow.com/a/41164225/4907187. but, alternatively you could use the same session but different variable names for each app – arisalsaila Mar 19 '17 at 12:54
  • I cannot use same sessions because each directory manage by different person. I use this website for hosting entire projects in a class at my college. Can I use session_name at the top of a page ? –  Mar 19 '17 at 13:00
  • yes, of course. make sure to set different session name for each app `session_name($string); session_start();` – arisalsaila Mar 19 '17 at 13:05

1 Answers1

0

If you have the possibility to use subdomains (app1.exapmple.com and app2.example.com), that is automatically solved.

gmc
  • 3,910
  • 2
  • 31
  • 44