Help: 2 different web apps, by 2 different users, want to use the

Help: 2 different web apps, by 2 different users, want to use the

am 21.04.2008 20:39:00 von Sugapablo

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

Re: Help: 2 different web apps, by 2 different users, want to use the same session filename for data

am 21.04.2008 22:09:01 von luiheidsgoeroe

On Mon, 21 Apr 2008 20:39:00 +0200, sugapablo
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

Re: Help: 2 different web apps, by 2 different users, want to use the same session filename for dat

am 21.04.2008 22:09:44 von webmasterNOSPAMTHANKS

*** 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.configuration.php#ini.s ession.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
--