Mailing List Archive

Conflicting PHPSESSID cookies when accessing two wikis on the same site
Hi.

I've looked for an answer to this in the FAQ and also in the archives
of the mailing list.

I run a mediawiki wiki, and allow my browser to accept cookies that
store my wiki user name and password. This works fine. However, I
recently added a second wiki on the same server and now find that
every time I switch from looking at one wiki to another I have to
re-login to each wiki.

I had a quick look at my browser's cookies and it seems like the right
thing is being done for the name and password cookies (these both
contain the wiki name, making them wiki specific). But there is a
single PHPSESSID cookie which I guess is the culprit. I.e., if I look
at wiki A and then go to wiki B and log in, I get a new PHPSESSID
cookie. This, I am guessing, is then invalid when I return to wiki A.

Is that likely to be what's causing my problem? If so, what can I do
about it?

Thanks,
Terry.
Re: Conflicting PHPSESSID cookies when accessing two wikis on the same site [ In reply to ]
On Nov 8, 2004, at 12:11 AM, Terry Jones wrote:
> I had a quick look at my browser's cookies and it seems like the right
> thing is being done for the name and password cookies (these both
> contain the wiki name, making them wiki specific). But there is a
> single PHPSESSID cookie which I guess is the culprit. I.e., if I look
> at wiki A and then go to wiki B and log in, I get a new PHPSESSID
> cookie. This, I am guessing, is then invalid when I return to wiki A.
>
> Is that likely to be what's causing my problem? If so, what can I do
> about it?

You can change the cookie name used by PHP's sessions in php.ini, the
Apache configuration, perhaps the .htaccess file, or at runtime. For
instance put something like this in LocalSettings.php:
ini_set("session.name", "{$wgSitename}Session" );

-- brion vibber (brion @ pobox.com)
Re: Conflicting PHPSESSID cookies when accessing two wikis on the same site [ In reply to ]
If possible (I'm not sure it is), you may want to have the two wikis
use the same User table. This, of course, may conflict with your
intentions would be a bit "hacky" to implement.

Of course, even if you got it to work, I'm not sure how well it would
work (depending on how much is stored in the User table).

Are there any mechanisms for sharing tables in MediaWiki?

On Mon, 8 Nov 2004 09:11:20 +0100, Terry Jones <tc.jones@jones.tc> wrote:
>
> Hi.
>
> I've looked for an answer to this in the FAQ and also in the archives
> of the mailing list.
>
> I run a mediawiki wiki, and allow my browser to accept cookies that
> store my wiki user name and password. This works fine. However, I
> recently added a second wiki on the same server and now find that
> every time I switch from looking at one wiki to another I have to
> re-login to each wiki.
>
> I had a quick look at my browser's cookies and it seems like the right
> thing is being done for the name and password cookies (these both
> contain the wiki name, making them wiki specific). But there is a
> single PHPSESSID cookie which I guess is the culprit. I.e., if I look
> at wiki A and then go to wiki B and log in, I get a new PHPSESSID
> cookie. This, I am guessing, is then invalid when I return to wiki A.
>
> Is that likely to be what's causing my problem? If so, what can I do
> about it?
>
> Thanks,
> Terry.
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l@Wikimedia.org
> http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
>


--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to Gmail!
Re: Conflicting PHPSESSID cookies when accessing two wikis on the same site [ In reply to ]
This may be helpful. In /Includes/DefaultSettings.php, lines 84-86 in
my version:

# Other wikis on this site, can be administered from a single developer account
# Array, interwiki prefix => database name
$wgLocalDatabases = array();

Try setting this to the other wiki's, if you can. (I'm not sure if
this is what you want, so you may want to try it on a private server
first)

On Tue, 9 Nov 2004 15:04:37 -0500, Jamie Bliss <astronouth7303@gmail.com> wrote:
> If possible (I'm not sure it is), you may want to have the two wikis
> use the same User table. This, of course, may conflict with your
> intentions would be a bit "hacky" to implement.
>
> Of course, even if you got it to work, I'm not sure how well it would
> work (depending on how much is stored in the User table).
>
> Are there any mechanisms for sharing tables in MediaWiki?
>
>
>
> On Mon, 8 Nov 2004 09:11:20 +0100, Terry Jones <tc.jones@jones.tc> wrote:
> >
> > Hi.
> >
> > I've looked for an answer to this in the FAQ and also in the archives
> > of the mailing list.
> >
> > I run a mediawiki wiki, and allow my browser to accept cookies that
> > store my wiki user name and password. This works fine. However, I
> > recently added a second wiki on the same server and now find that
> > every time I switch from looking at one wiki to another I have to
> > re-login to each wiki.
> >
> > I had a quick look at my browser's cookies and it seems like the right
> > thing is being done for the name and password cookies (these both
> > contain the wiki name, making them wiki specific). But there is a
> > single PHPSESSID cookie which I guess is the culprit. I.e., if I look
> > at wiki A and then go to wiki B and log in, I get a new PHPSESSID
> > cookie. This, I am guessing, is then invalid when I return to wiki A.
> >
> > Is that likely to be what's causing my problem? If so, what can I do
> > about it?
> >
> > Thanks,
> > Terry.
> > _______________________________________________
> > MediaWiki-l mailing list
> > MediaWiki-l@Wikimedia.org
> > http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
> >
>
>
> --
> -------------------------------------------------------------------
> http://endeavour.zapto.org/astro73/
> Thank you to JosephM for inviting me to Gmail!
>


--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to Gmail!
Re: Conflicting PHPSESSID cookies when accessing two wikis on the same site [ In reply to ]
On Nov 9, 2004, at 12:04 PM, Jamie Bliss wrote:
> If possible (I'm not sure it is), you may want to have the two wikis
> use the same User table. This, of course, may conflict with your
> intentions would be a bit "hacky" to implement.
>
> Of course, even if you got it to work, I'm not sure how well it would
> work (depending on how much is stored in the User table).
>
> Are there any mechanisms for sharing tables in MediaWiki?

In 1.4 there is an experimental option for using a shared user table.
(1.4 is not ready yet and should not be used except for development
work. Very likely the option doesn't work properly with recent changes
to the permissions stuff.)

-- brion vibber (brion @ pobox.com)
Re: Conflicting PHPSESSID cookies when accessing two wikis on the same site [ In reply to ]
On Nov 9, 2004, at 1:03 PM, Jamie Bliss wrote:
> This may be helpful. In /Includes/DefaultSettings.php, lines 84-86 in
> my version:
>
> # Other wikis on this site, can be administered from a single
> developer account
> # Array, interwiki prefix => database name
> $wgLocalDatabases = array();
>
> Try setting this to the other wiki's, if you can. (I'm not sure if
> this is what you want, so you may want to try it on a private server
> first)

This is for using Special:Makesysop to adjust user permissions on other
wikis on the same server. It has nothing to do with login cookies.

-- brion vibber (brion @ pobox.com)