forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Cavey on July 10, 2010, 02:50:11 pm

Title: A valid token could not be found
Post by: Cavey on July 10, 2010, 02:50:11 pm
Hello all,

Need some advice, i have upgraded to the newest version (version 1.5.6 from version 1.4.7). Whenever i try to set any settings, it will keep prompting the following error

File: /home/cavey/public_html/CPG-Tango/usermgr.php - Line: 1050 (File shown here changes with the last function)
or
Error
A valid form token could not be found.
File: /home/cavey/public_html/CPG-Tango/logout.php - Line: 31 

I checked the token lifetime and it is at the default 900. With this issue i cannot save or do anything

I would like to create an account as requested for testing purposes but the following above is preventing me from doing so. My website's CPG is at http://tango.kicks-ass.org/CPG-Tango

Any advice will be appreciated. Thank you in advice.


Title: Re: A valid token could not be found
Post by: Joe Carver on July 10, 2010, 03:23:07 pm
Did you run update.php?
Title: Re: A valid token could not be found
Post by: Cavey on July 10, 2010, 04:09:44 pm
Opps yup should be update rather than upgrade.
Title: Re: A valid token could not be found
Post by: phill104 on July 10, 2010, 05:30:55 pm
Is it fixed then? If so can you mark your thread as solved for the benefit of others - http://forum.coppermine-gallery.net/index.php/topic,55415.msg270631.html#msg270631
Title: Re: A valid token could not be found
Post by: Cavey on July 10, 2010, 05:49:55 pm
Hello Phill ,

Sorry for the confusion. it is not fixed. Was just replying that i did an update instead of an upgrade as stated in the first paragraph, still getting the error. Could it be a server setting? I have 2 upgraded 1.5.6 CPGs running on the same server (suffix is different for both) and both are getting the same issue.

Title: Re: A valid token could not be found
Post by: Joe Carver on July 10, 2010, 07:22:52 pm
Opps yup should be update rather than upgrade.
??? I don't understand.
If you did not understand, I meant: http://tango.kicks-ass.org/CPG-Tango/update.php
Title: Re: A valid token could not be found
Post by: Cavey on July 11, 2010, 05:39:27 am
Hello Joe,

Sorry for the confusion, Yes i did run update.php to 1.5.6, everything appeared to be successful, but still getting the same error.

Anyway i tried deleting all files/db and did a fresh install and still got the error, just wondering, for the server end, is there a need to enable a php function in order for the token thing to work?

Thank you.
Title: Re: A valid token could not be found
Post by: Joachim Müller on July 11, 2010, 10:15:34 am
What PHP version do you have on your server?
Title: Re: A valid token could not be found
Post by: Cavey on July 11, 2010, 10:28:20 am
PHP Version 5.2.10
MySQL: 5.0.91
Apache: 2.2.0
Title: Re: A valid token could not be found
Post by: Joachim Müller on July 11, 2010, 10:33:13 am
Please post a non-admin test user account with privileges to have personal albums.
Title: Re: A valid token could not be found
Post by: Cavey on July 11, 2010, 10:51:11 am
Hello Joachim,

i would like to do so but the token error is stopping me from creating an account or from doing anything else. I have just set up another CPG Test gallery on that server for testing and troubleshooting purposes. If it is ok, can i PM you the details as it contains information the admin account.
Title: Re: A valid token could not be found
Post by: Cavey on July 14, 2010, 05:42:57 pm
Hello All,

Just thought i will update this thread before changing it to solved. After much testing, i found out that it was my own Internet Service Provider (ISP) causing this issue, tested over at 2 friend's places using different ISPs and it is ok. Server and CPG fresh installation and update was fine and wasnt the cause of this issue

Not sure what information sent from server to ISP to my pc is being blocked but i have already asked them to investigate. If there is a firm answer will post it here to help others.
Title: Re: A valid token could not be found
Post by: Joe Carver on July 15, 2010, 12:32:57 am
Check to see if your IP address is stable over time. If you are on win, then open a command window and type....  

ipconfig /all     and recheck it a couple/few minutes later.


Or, use a web service  that echos your ip back to you
( http://network-tools.com works well, I use it for other reasons )
Title: Re: A valid token could not be found
Post by: Αndré on July 15, 2010, 07:46:17 am
I don't know how the usual home networking looks in Singapore or in the US. But in Germany almost everyone has a DSL or cable connection with a router between the modem and the PC. So ipconfig /all returns your internal IP which doesn't matter in that scenario.

Please have a look how the token is generated:
Code: [Select]
$token = md5(USER_ID . $raw_ip . $superCage->server->getRaw('HTTP_USER_AGENT') . $CONFIG['site_token'] . $timestamp);Each value has to be identical to generate a valid token. So your IP mustn't change and your HTTP_USER_AGENT has to be the same, too.

If you have serious trouble with the form token, you have to determine where the culprit lies (probably your IP address) and adjust the token generation.
Title: Re: A valid token could not be found
Post by: Cavey on July 15, 2010, 09:19:02 am
Hello Joe, Andre,

For myself i am using a ADSL router, so yes the ip will be a private ip and wont change much there. Just for further testing I used a ADSL modem for direct connection to my PC and got the same result. IP and Browser were still the same ones.

Putting myself back to the ADSL router, when i used my ISP's proxy, it seems to work well,

Just wondering is it a good idea to remove the raw_ip from the line $token = md5(USER_ID . $raw_ip . $superCage->server->getRaw('HTTP_USER_AGENT') . $CONFIG['site_token'] . $timestamp);, can token generation work without that?
Title: Re: A valid token could not be found
Post by: Αndré on July 15, 2010, 09:25:18 am
can token generation work without that?
Yes. The same function is used for creating a token and checking if a token is (still) valid.
Title: Re: A valid token could not be found
Post by: Cavey on July 15, 2010, 12:20:16 pm
Thank you Andre, this did the trick with the token error.

However will try to look into why this happens to be the case for my IP/ISP