I can't login to my moodle site

I can't login to my moodle site

by Kevin Freeborn -
Number of replies: 17

This site has been working fine for a couple years.  I think I am moodle v1.6 -have had no problems so left it alone.

As of yesterday afternnon I showed the site to someone and it was working.  Today someone complained they could not login and I went to see what was wrong and I can't login!!!!!!!!! as admin.

the site appears to work in that I changed my password and the site sent a new one but I still can't login as a user or admin.

I use a shared server and the support there says they have done nothing (hmmmm).

I tried having the whole site restored from a time prior to the problem  - no luck.

The home page works fine except the language block is missing - it was there yesterday.

I need some help as soon as possible

Average of ratings: -
In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
When you say you can't log in, what exactly does happen? Are you using external authentication of any kind and, if you are, is the admin account you are using hooked up to that external authentication?

Try with Debugging on - you'll need to add the settings in your config.php file.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -

Thank you Howard.

I enter my username and password in the login block.  The web site re-loads but continues to say I am not logged in.  If I try a second time it takes me to the main login page where it tells me my session has timed out.  I try again and end up stuck on the login page in a loop.

I am not hooked up to an external authentication (that I know of).  My moodle site is hosted on a Bell Server using a shared server Hosting plan.

I will turn debugging on using my ftp to change my config.php script.

In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -

I tried running the session test and this is what I got:

Session found - welcome back!

Sessions are working correctly

Reload this page

I am guessing this is a good response.

In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -

I turned on debugging using MyPHPAdmin by running the script in the document you linked me to.

When I tried to login I got this error message:

The form did not come from this page! (referer = http://www.nfstp.ca)

I am not sure what this means.

In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
When I try to log in to your site. It always says "Your session has timed out. Please login again.".

This definitely implies a session problem. It could be as simple as a permissions issue on your moodledata directory - especially the sessions subdirectory. However, anything that breaks sessions would cause this.

EDIT:
You might also want to try turning 'secureforms' off in the admin menu. You would have switched it on at some point. I *think* that was in 1.6, it isn't any longer.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -
I did try changing the permissions in the moodledata directory and sessions sub-directory.  They were at 767 and I changed them to 777 using my ftp FileZilla.  It did not seem to make a difference.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -

I have logged onto PHPMYADMIN and when I look at the mdl_user tables i shows this warning:

The following indexes appear to be equal and one of them should be removed: PRIMARY, id

Not sure if this has something to do with the problem.

In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I don't think so.... check the secureforms settting noted above!
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -
I am not sure how to turn it off from outside of the web site.  I can't login as admin.  Do I edit a file to do that?
In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I'm struggling to help as 1.6 is a bit distant now. You want to have a look in your mdl_config database table. Find the record where name='secureforms' (or whatever it's called) and make sure that value=0 for that record.

Hope that makes sense.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -
Thanks, I was able to turn secure forms off.  Still can't seem to login though??
In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Just to be certain. Go and try this on a different browser and/or clear all your cookies. I'm at the point of hoping you have fixed it but a cookie is "stuck".

Also, when you changed the permissions on your sesssion folder you did do it recursively? You can reasonably safely delete it and it will be recreated.

AND... you're not using database sessions are you? (a whole different bunch of possible problems)

AND... this can happen if you run out of disk space (or quota) on the server.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -

I did try with a different browser and on a different computer - no luck.  Now it does not take me to the main login page - it just loops back to the home page.

I am not sure what you mean by "recursively".  I used FileZilla FTP software to view file attributes and changed the settings within the ftp software.

When you ask about database sessions - all my data is located in a MySql database on sqlc9/megasqlservers.com.  Not sure if this means I am running database sessions.

Just checked and I AM OVER QUOTA!!!

I will try deleting some stuff and see what happens.

In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Kevin Freeborn -
I have had no luck.  I deleted files to be under quota on the server but still cannot login.
In reply to Howard Miller

Re: I can't login to my moodle site

by Kevin Freeborn -
It turns out the session files I thought I had deleted were not deleted. I have asked the Hosting company to delete the moodledata/session/*.* files. There are about 82 thousand files in this folder?? No wonder I am over quota.
In reply to Kevin Freeborn

Re: I can't login to my moodle site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
At least it sounds like you have a solution.

I hadn't really thought about this much before but there doesn't appear to be a mechanism for cleaning up these files. It's not strictly speaking a Moodle issue. There's some discussion around the web regarding writing cron scripts do do regular cleanups of old files.