using multiple apache

using multiple apache

am 15.08.2008 08:39:11 von ron

Hi,

I'm not sure if this is the correct mailing list.

anyway, i have multiple apache servers, my pages are on php, i'm using
DNS SRV, so that at least it's up even when one goes down.

my prob is, user are logging in on my site and i am using their username
as a session variable to manage things on their portal, but sometimes
when they they login on server 1, because of dns srv, they sometimes
browse server 2 while they are logged in on server 1. so when they are
on server 2 the session variables are lost already.

both apache are talking to a single mysql cluster, if i save my session
on the db, would it prevent the session variable to get lost when a user
1 brose from server 1 o server 2 or vice versa?

thank you

regards,
ron

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: using multiple apache

am 15.08.2008 12:52:59 von Evert Lammerts

You can set a save handler for the session and save the session to the
database (http://php.net/session_set_save_handler). But it will be
hard for server 2 to find out which data belongs to a user that just
came from server 1 - you can't rely on a session id found in the url
or in a cookie since... well, that's obvious. However, there might be
some secure standard for this that I'm not aware of (plus a million
semi secure hacks to think of).

I think I'd rather solve it on a different level and ensure HA by load
balancing the two apache nodes. Check linuxvirtualserver.org and
linux-ha.org - and google gives you tons of articles telling you how
to set it up.

On Fri, Aug 15, 2008 at 8:39 AM, Ron wrote:
> Hi,
>
> I'm not sure if this is the correct mailing list.
>
> anyway, i have multiple apache servers, my pages are on php, i'm using DNS
> SRV, so that at least it's up even when one goes down.
>
> my prob is, user are logging in on my site and i am using their username as
> a session variable to manage things on their portal, but sometimes when they
> they login on server 1, because of dns srv, they sometimes browse server 2
> while they are logged in on server 1. so when they are on server 2 the
> session variables are lost already.
>
> both apache are talking to a single mysql cluster, if i save my session on
> the db, would it prevent the session variable to get lost when a user 1
> brose from server 1 o server 2 or vice versa?
>
> thank you
>
> regards,
> ron
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php