Announcement

#1 2012-06-29 15:08:18

andy
Member
2012-06-28
7

Piwigo & Cookies

I am having a rather odd cookies problem. Before I describe my problem, let me tell you some history, which may well prove to be useful.

Originally, I was running Piwigo and several other apps on an old discarded desktop "server". It was getting flaky (RAM) so I replaced it with another ageing yet considerably newer desktop converted into a "server". I'm running a small family site and my meager bandwidth is my biggest limiting factor for most things, not the server hardware. On the old server Piwigo was installed via Ubuntu's repos and was running off of Apache.

When I moved over to the new server, I decided to switch from Apache to Cherokee. I copied my MySQL system onto the new computer. When I installed Wordpress and Piwigo onto the new system, I downloaded the zip files and installed them that way, wanting to stay more up to date than I had in the past using Ubuntu's repos. I also copied over my pictures and what not for both Wordpress and Piwigo.

After tinkering with all of this for a couple of days, I have Wordpress up and running 100% and Piwigo is 90% up and running. In fact, Piwigo _is_ running. I can go to www.team-kandy.net/piwigo/ and all looks lovely at first glance. I set up the new installation of Piwigo to use the same user name and password as the old installation and it appears to be accessing the MySQL database on the system. Furthermore, it can clearly find and use all of the pictures. Browsing the site is slow but functional (bandwidth).

I don't have any apparent problems until I go to log in. When I go to log in (with a valid user name / password or not) I am told that: "Cookies are blocked or not supported by your browser. You must enable cookies to log in." That's odd because my browser DOES have cookies enabled. I'm running an up-to-date Firefox with the Do Not Track stuff disabled, just in case that was the problem. I can replicate this behavior on Chromium, IE, etc. The funny thing is,  I can actually find the Piwigo session cookie on my machine from my domain. I have also noticed I get the same error if my attempt to log in legitimately or not. For example. There is no use such as:
User Name = Bob
Password = Jones

But, if I attempt to log in as this mysterious non-user, I am told that I have a cookies problem when I should be told no such user exists. To me, this feels like Piwigo is failing to find the referenced session and is therefore complaining about cookies when it should be complaining about a database error, but I may be wrong. It may be something to do with Cherokee.

I suspect I'm doing something incredibly silly and if I just correct _X_, everything else will fall into place but I just don't know what _X_ is.

Here is a redacted copy of my database.inc.php file. I have tested the user name and password on the new machine and I am able to log into MySQL on the local machine using these credentials.


<?php
$conf['dblayer'] = 'mysql';
$conf['db_base'] = 'piwigo';
$conf['db_user'] = 'XXXXXXXXXXXXXXXXXXXXX';
$conf['db_password'] = '##################';
$conf['db_host'] = 'localhost';

$prefixeTable = 'piwigo_';

define('PHPWG_INSTALLED', true);
define('PWG_CHARSET', 'utf-8');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

?>

Thoughts? I have run both the install.php and the upgrade.php (which fixed numerous database errors caused by the fact I was using an old version of Piwigo previously from the Ubuntu repos. I really do think the database stuff is working correctly, but I threw it in here because it does kinda feel like a database problem.

Thanks

Offline

 

#2 2012-06-29 15:34:52

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo & Cookies

Hello,
well... that seems weird indeed... have you tried to change :

$conf['remember_me_name'] = 'pwg_remember';


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2012-06-29 15:44:03

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

No, which configuration file is that hiding in?

I should have mentioned in my first post that I'm not real familiar with Piwigo. I do a little PHP dev, but I'm not well versed in Piwigo's internal structure. But, I'm willing to learn!

Offline

 

#4 2012-06-29 15:44:57

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo & Cookies

by using LocalFiles Editor


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2012-06-29 15:47:39

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

Which would be easier if I could log in, which I can not.

My root installation is at /var/www/piwigo (real original, I know). If you could tell me which file it is in, assuming we agree to start at /var/www/piwigo/ I can edit it remotely with Vim. Or I could just grep for it but it seems easier to ask.

Offline

 

#6 2012-06-29 15:49:38

flop25
Piwigo Team
2006-07-06
7037

Re: Piwigo & Cookies

oups ^^
create/modify local/config/config.inc.php


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2012-06-29 16:04:36

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Piwigo & Cookies

somehow piwigo/php does not detect correctly the root piwigo url

Code:

Set-Cookie  pwg_id=ldpsl0stv8q0n4uqcl4lp27ng7; path=//piwigo/; HttpOnly

the problem comes from //piwigo (double slash) -not workign wit browsers
in adition when found in html // at the beginning of an url has special meaning.

you should debug the cookie_path() function ( in include/functions_cookie.inc.php I believe)

Offline

 

#8 2012-06-29 16:21:27

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

Well, I created the file and reset cherokee but it didn't change anything. Just to be thorough, I reset the whole machine but I'm still getting that same error.

Offline

 

#9 2012-06-29 16:23:40

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

rvelices wrote:

somehow piwigo/php does not detect correctly the root piwigo url

Ahh. I didn't think to look at the contents of the cookie. Now I see what you are talking about. You're right //piwigo is meaningless. I need to figure out where Piwigo stores its root URL.

Offline

 

#10 2012-06-29 16:50:53

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

I need to figure out where the values for the array $_SERVER are set. I bet somehow when I changed everything up this setting didn't follow along. I looked in the MySQL databsae and I don't see any settings for the Path Info or Redirect URL. If I could find where these are stored I bet I could fix this once and for all.

Offline

 

#11 2012-06-29 18:29:49

rvelices
Former Piwigo Team
2005-12-29
1960

Re: Piwigo & Cookies

andy as i said in my previous message everything occurs in function cookie_path() - is computed and not sotred in mysql ...
unfortunately you are on your own because as far as i know no developer on piwigo side uses this server ...

Offline

 

#12 2012-06-29 19:30:43

andy
Member
2012-06-28
7

Re: Piwigo & Cookies

rvelices wrote:

andy as i said in my previous message everything occurs in function cookie_path() - is computed and not sotred in mysql ...
unfortunately you are on your own because as far as i know no developer on piwigo side uses this server ...

Unless I am really misreading cookie_path(), it is calling on a global array to get what it needs to create the cookie string path. I will have to keep poking my nose around this until I figure it out, but at least I've got a direction to go in.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact