2.3.4; Moved server, now "Your session has timed out. Please login again"

2.3.4; Moved server, now "Your session has timed out. Please login again"

by tim st.clair -
Number of replies: 5
Picture of Plugin developers

I moved my installation from one server to another (out of a test subfolder to its own vps) and now I can't log in. The url changed, the db server has moved, but everything other than config.php is the same files (copied) so it's not a version difference / upgrade issue. i set up config.php properly to use the new values.

Every user, including admin, is getting the message 'Your session has timed out. Please login again'. If I enter an incorrect user or password I get the correct warning message, so the system *is* working. 

I looked into the mdl_config table and found that the 'siteidentifier' value still has some of the old url (not the full path) in it, and I'm guessing that's just key and not a check value; can't see any other values that should affect it.

I tried generating a new password hash and popping that into the db for the admin user, but couldn't get that to happen either.

Average of ratings: -
In reply to tim st.clair

Re: 2.3.4; Moved server, now "Your session has timed out. Please login again"

by tim st.clair -
Picture of Plugin developers

Hi anybody reading this. I've worked this out myself (solution: can't have a php.ini in the root of my web site), but in the spirit of hopefully helping anyone else who might come across this in their own servers, here's what happened to me.

At the time of this problem, my specific version is 2012062504.01 (2.3.4+ Build: 20130118).

I have moved from a sub-folder on a test box to a dedicated vps with cpanel. after some confusing with the host getting php 5.3.x installed (they seem to default to 5.2 still for some paranoid reason), managed to get moodle showing up.

I had to ensure that the moodledata folder had the correct permissions (0777).

I tried setting my sessions to file-side (rather than db-side, as is the default in moodle 2). I did this by adding 

$CFG-> dbsessions = "0";

to my config.php (this has now been removed again as the site is running). This post was helpful in determining if the site was actually running (watching sessions get created, confirming that it was taling to the db, etc).

My .htaccess file looks like this (with strips www off the front, since it's redundant):

# Use PHP 5.3
# AddType application/x-httpd-php53 .php
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]

My problem appears to be that the host has added a php.ini file to the root folder.

AcceptPathInfo
cgi.fix_pathinfo=1

I'm not sure what these lines do, and there's all sorts of posts related to Moodle that assure that one host requires them and another does not in order to get Moodle to play ball. I tried changing my (entire) php.ini file to this:

post_max_size = 100M
upload_max_filesize = 100M

but that did not help. Also, my host has chosen the absurd default upload limit of 2MB, hence my attempt to change them, so I guess I won't be uploading my 120MB scorm packages after all... 

Anyway, as stated earlier, my ONLY solution so far is to remove the entire php.ini file (even if it is empty, moodle is still breaking)

It would be nice if someone could explain a possible reason for this in a reply, as a quick google reveals that it's a common enough problem that stumps a lot of people.

In reply to tim st.clair

Re: 2.3.4; Moved server, now "Your session has timed out. Please login again"

by Ken Task -
Picture of Particularly helpful Moodlers

Someone might be able to explain (maybe not me), but can't do so without some more information related to hosting provider and operating system.  As you suggest, not all hosting providers build their VPS's the same nor do they offer the same packages.

What was the 'google search' you mentioned?

Some php variables can be set/changed only in php.ini.  Some can be modified in .htaccess (per directory as opposed to system wide).  See http://www.php.net/manual/en/ini.core.php for an overview.

In php.ini, if you have access to and can edit:

post_max_size = 100M
upload_max_filesize = 100M

Suggest creating a phpinfo.php file and place it at document root of web server (assuming apache here):

http://php.net/manual/en/function.phpinfo.php

The output of that will show what php.ini the system is using and other details that may/may not be important.

Using .htaccess one could:

php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value max_execution_time 200
php_value max_input_time 200

'spirit of sharing', Ken

In reply to Ken Task

Re: 2.3.4; Moved server, now "Your session has timed out. Please login again"

by tim st.clair -
Picture of Plugin developers

er google "Your session has timed out +site:moodle.org" and click through to many...

my host is being an utter bastard and won't hand out access to php.ini (which is to say, I asked for it, they created it and then locked editing from my account, which is the site admin account. WTF?). they will create it and change it themselves, but only to values they see fit. I asked for max post 256mb, they made it 32mb. I asked for max memory to 128mb, they change it to 64mb. Wonderful experience dealing with them, don't even ask for something as silly as ssh access to your own server. Ugh!

In reply to tim st.clair

Re: 2.3.4; Moved server, now "Your session has timed out. Please login again"

by Ken Task -
Picture of Particularly helpful Moodlers

Sounds like you need to seek hosting elsewhere.  When you do, shop wisely now that you know some of the specs required to run 2.3 and/or 2.4.  If one can afford it, a dedicated host gives one free reign.

Best of luck.

'spirit of sharing', Ken

In reply to tim st.clair

Re: 2.3.4; Moved server, now "Your session has timed out. Please login again"

by kushal mehta -

this is a common error while transferring server.

you need to do changes into config files and db as well to deal this issue.

let me know if you can not handle this on my mail

kushalmehta27@gmail.com