By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,760 Members | 995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,760 IT Pros & Developers. It's quick & easy.

Help: 2 different web apps, by 2 different users, want to use thesame session filename for data.

P: n/a
I have a server where two different users are each running a different
web application. I installed SugarCRM for one, and Info@Hand (built
from SugarCRM) for the other. Both are trying to save and access the
same file in the PHP session_save_path (/tmp/
sess_c2b09aac9b607b1df05d73c7f1c4cbb1).

If I delete that file, the whichever app runs first, saves data under
that filename and the other will fail. They both keep regenerating
the same filename. I thought that data stored in the
session_save_path had random filenames?

How can I fix/get around this?
--
Russ Schneider (a.k.a. Sugapablo)
http://www.sugapablo.com
Jun 2 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Mon, 21 Apr 2008 20:39:00 +0200, sugapablo <su*******@hotmail.com>
wrote:
I have a server where two different users are each running a different
web application. I installed SugarCRM for one, and Info@Hand (built
from SugarCRM) for the other. Both are trying to save and access the
same file in the PHP session_save_path (/tmp/
sess_c2b09aac9b607b1df05d73c7f1c4cbb1).

If I delete that file, the whichever app runs first, saves data under
that filename and the other will fail. They both keep regenerating
the same filename. I thought that data stored in the
session_save_path had random filenames?
Unless a filename is allready 'given' by a session-id in a cookie or
GET/POST params.
How can I fix/get around this?
They shouldn't fail with a session holding the data of both, save for name
clashes in the variables / arrays. However, it is possible they have
they're own session_handler (try to search in the code for a
session_set_save_handler(). If so, more info about these handlers is
needed.

If not, and they are in different paths, make the session-id dependable on
the path by setting is explicitly with session_set_cookie_params().
--
Your sig seperator is broken.. It's missing a space after it.
--
Rik Wasmus
Jun 2 '08 #2

P: n/a
*** sugapablo escribió/wrote (Mon, 21 Apr 2008 11:39:00 -0700 (PDT)):
I have a server where two different users are each running a different
web application. I installed SugarCRM for one, and Info@Hand (built
from SugarCRM) for the other. Both are trying to save and access the
same file in the PHP session_save_path (/tmp/
sess_c2b09aac9b607b1df05d73c7f1c4cbb1).

If I delete that file, the whichever app runs first, saves data under
that filename and the other will fail. They both keep regenerating
the same filename. I thought that data stored in the
session_save_path had random filenames?
They generate a random session ID... unless the browser sends a previous
ID. I'd say you have both apps in different directories of the same site.
If there's a conflict with session data you can restrict the scope of the
session ID cookie with this directive:

session.cookie_path

If PHP runs as Apache module you can set it in two .htaccess files, one for
each app:

In /home/site/www/app1/.htaccess:

session.cookie_path=/app1/

In /home/site/www/app2/.htaccess:

session.cookie_path=/app2/

More info:
http://es2.php.net/manual/en/session...on.cookie-path
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
Jun 2 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.