Remote Direct Server Help

wski3731

New Member
YetiShare User
Mar 13, 2014
21
0
0
Hello, new client here. First of all I wanted to thank and congratulate the YetiShare developers on a great products. I've been looking for a good file hosting scrip for a while now and I think I finally found it!

Now, I've been running the script for almost a week now without any problems. Yesterday I tried to add a direct server to my site and I'm facing some weird problems. I've successfully added a server in File Servers section and by running a test all is green. My problem arises when I enable the file server. As soon as I enable it, I become stuck in a login loop. Basically when the server is on, I try to log in but it loops back to the login page again and again.
I also can't upload any files to the file server, the process hits 100% but nothing happens. I checked error logs but couldn't find anything wrong there. Thanks for the help.
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
Hi,

Welcome to the site and thanks for your comments. :)

I've seen this issue before when PHP time is out of sync with MySQL time. There's a function which clears any sessions after a period of time and if the PHP & MySQL time are out of sync, it can fail. Can you try these:

- First make sure all your times are synced, then test. We output these in the admin area right at the bottom of this page - /admin/server_info.php. Login to the admin area and check this page on both servers.

- If that's fine, text removing the session delete line. This is in includes/class.dbsession.php around line 63. Remove this and re-test:

Code:
$db->query('DELETE FROM `sessions` WHERE `updated_on` < :updated_on', array('updated_on' => time() - $max));
- Failing that try removing line 104 in the same file:

Code:
$db->query('DELETE FROM `session_transfer` WHERE UNIX_TIMESTAMP(date_added) < (now() - INTERVAL 1 MONTH)');
- Failing that, send me temp site access via the contact form above and we'll take a look. :)

Let me know how you get on.

Regards,
Adam.
 

wski3731

New Member
YetiShare User
Mar 13, 2014
21
0
0
Thanks for the quick update, your first suggestions already seems to be the problem for me. Is this due the fact that it's 2 servers? I'm looking into syncing these.

MySQL Date/Time: 2014-03-19 23:50:51
PHP Date/Time: 2014-03-19 22:51:01
 

wski3731

New Member
YetiShare User
Mar 13, 2014
21
0
0
I fixed php/mysql time issues and tried other options you listed without any luck. I've sent you site access. PS: we should be able to edit our posts. :)
 

wski3731

New Member
YetiShare User
Mar 13, 2014
21
0
0
Hello adam, did you receive my site access that I've sent? Had a chance to look at my site? Thanks.
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
Hi,

I've received the details so I'll take a look this morning for you. :)

Regards,
Adam.
 

wski3731

New Member
YetiShare User
Mar 13, 2014
21
0
0
Just wanted to post here if others are having the login loop problem. For my case it was caused by Suhosin (the plugin came with my ubuntu php installation). The problem is cause due to Suhosin's session data encryption as Adam figured out, so the solution is to disable them by adding the following lines into php.ini or suhosin.ini.

suhosin.session.cryptua = Off
suhosin.session.cryptdocroot = Off
suhosin.session.encrypt = Off (or php_flag suhosin.session.encrypt Off add in .htaccess)

Some reference links:
http://www.php.net/manual/en/function.session-set-save-handler.php#89564
http://stackoverflow.com/a/6477813

Thanks again Adam, and I hope this will help others having similar issues.
 

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
Thanks for posting for others. I'm also going to add something to the script to check for suhosin and flag up a message if it's found.

It was tricky to track down but we got there! Thanks for your patience. :)