1

I have to two folders in my localhost.

domain1 and domain2 - each one with is own .htaccess

Both .htaccess are only used to set the following:

php_value session.gc_maxlifetime 172800
php_value session.cookie_lifetime 0
php_value session.save_path './temp/'

I have two problems: 1 - When I login in one site the session on the other is destroyed(it redirects me to the login page when I try to load any page) and vice-versa

2 - The session.save_path only works with absolute path. If I use './temp/' it shows an error:

Warning: session_start() [function.session-start]: open(....., O_RDWR) failed: No such file or directory (2) in...

If I use an absolute path '/var/www/domain1/temp/' or '/var/www/domain2/temp/' it works but I still have the first problem.

Thank you in advance for any help.

P.S. without the .htaccess files the login works without problems

  • Have you read this ? http://stackoverflow.com/questions/13806701/secure-and-flexible-cross-domain-sessions – Pedro Lobito Apr 28 '15 at 12:15
  • @PedroLobito Hi Pedro, Thank for the suggestion but for what I understand from the post you mention the problem there is when the 2 sites somehow connect with each other. In my case I have 2 independent sites in the same host that are being affected by the .htaccess of the other. They don't share anything. Even the $_SESSION keys, created in the login execution, are different. I also found out that even if I only place the .htacces in one of the sites it has the same behaviour. – José Azevedo Apr 28 '15 at 14:05
  • @JoséAzevedo why not make it global and set it in the ini file instead htaccess? – Panama Jack Apr 28 '15 at 14:45
  • @PanamaJack Your comment doesn't quite answer my question but pointed me in the right direction to solve the problem temporarily. Thank you. – José Azevedo Apr 28 '15 at 16:24
  • Well that's why I didn't answer the question :). I was making a comment but at least you got a temp solution. – Panama Jack Apr 28 '15 at 16:58

0 Answers0