Wrong user after log in

Wrong user after log in

by Andrew Johnson -
Number of replies: 47

Okay, this is not only weird, but it's driving me crazy!

After a student logs in, their information is not shown.  It actually shows some other user logged in.  It might be the last user, but I'm not sure.

I have several student accounts I use to test with and every time I log in, it shows the same persons name and account information, but never mine.  

Not sure if this could be a problem in php dbase or somewhere else.

Recently upgraded to 3.1.

No error messages using debugging.

Any help would be greatly appreciated.


Thanks,

Andy

Average of ratings: -
In reply to Andrew Johnson

Re: Wrong user after log in

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

How is authentication set up on your site? Are these just manual users or something else?

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

They can get their moodle account without approvals.  Some courses are self-enrollment and others are required to get approval.

In reply to Andrew Johnson

Re: Wrong user after log in

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

You're mixing up enrolment (which we don't care about here) and authentication. 

When a use logs in we are using an 'authentication' plugin. The internal ones should not be an issue, but if you are authenticating against an external database then the problem could be outside Moodle. That would be the first place I would look. 

OR... you may have a custom authentication plugin (e.g. for Single Sign On with some other system) that is simply broken. 

I have never seen anything like this with core Moodle and internal authentication. 

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

My appologies.  Still learning.   


Using "Manual Accounts", "No Login", and "Email-Based Self-Registration".   Email one is used 99% of the time.  



In reply to Andrew Johnson

Re: Wrong user after log in

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

email and manual are basically the same thing. 

I'm incredibly sceptical that standard Moodle would do this. Are you absolutely, 100% certain that there are no hacks or other modifications to your site's code? 

Was it ok before you upgraded? If so, how did you upgrade? 

Is it possible for you to check your database? Is there any relationship between the login username and the record for the user who comes up instead. Is the 'wrong' user consistent or apparently random? We need some more clues here.

Have you got Debugging on? Have you checked your web server's error logs for anything being recorded?

In reply to Howard Miller

Re: Wrong user after log in

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Andrew - just adding that you've reported this to the tracker and the tracker issue is here https://tracker.moodle.org/browse/MDL-55306 (it's got a minor security issue label so might not be visible to all) On there Andrew you added a screenshot (in a Word doc) which might be useful to have on this forum (better to upload it as a image file) I am also sceptical that this is a bug (but I'm leaving the tracker report open for the time being) Since you offered (in the tracker report) for people to sign up and see for themselve, I did sign up but as a student it all looked fine to me.

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

Debugging didn't reveal any problems.  No recent errors in log file through Hostgator.

The wrong user seems to be the last person that logged in.  I have staff login and logout.  I login and their name showed up.  

I upgraded via zip file uploaded to my Hostgator server and ran the update from there.  

No changes to code that I am aware of.

After the update, I did have an issue logging in as the admin.  It wouldn't let me in.  I had to recreate the admin through the mdl_user table via Myphp in Hostgator.  Apache was also reset by Hostgator.

In reply to Andrew Johnson

Re: Wrong user after log in

by Robert Brenstein -
Do you use login-as at all? I suspect not. How did you exactly recreate the admin account? This might be the culprit.
In reply to Robert Brenstein

Re: Wrong user after log in

by Andrew Johnson -
I am trying to recall my steps, but I know I did make a change in my Hostgator MyAdmin area, but I don't recall exactly what I did change because of the admin log in problems.  Screen capture attached.  Not using log-in as.
In reply to Andrew Johnson

Re: Wrong user after log in

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 the nicest way... do you know what you are doing with MySQL... is there any possibility that you have stuffed up the mdl_user table?

When you say the "last person to login", what do you mean? The last person in the current browser, the last person who logged in *anywhere* or something else?

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

In the nicest way smile    Oh, yes, anything is possible.  I am still new at this lol


The last person to log in on the site.  Separate computer.

The moodledata folder is in the main folder tree, outside of public.htm folder, which contains the moodle directory.

Everything else on the site appears to be working fine. 

In reply to Andrew Johnson

Re: Wrong user after log in

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

Honestly, that's my assumption...

1. "I editing the mdl_user table because I couldn't log in as admin"

2. "Now I get weird login problems"

Hmmmm.....   if I was a betting man, as they say. 

Can you reproduce the problem every time? That is, can you write down a set of instructions that would allow somebody else to see the problem? I'm working up to offering to have a look at your site. But, being lazy, only if you make life easy for me wink

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

Probably the best way to reproduce it is to have 2 accounts.  Log in with one, log out, then log in with the other.  You should see your first name and info come up when you log in with the second account.  

In reply to Andrew Johnson

Re: Wrong user after log in

by Robert Brenstein -
Have you tried to quit browser before logging in as a new user? Does it help?
In reply to Robert Brenstein

Re: Wrong user after log in

by Andrew Johnson -

Tried clearing browser histories, cache, 3 different browsers and different computers.  Same thing.

In reply to Robert Brenstein

Re: Wrong user after log in

by Andrew Johnson -

Yes.


Okay, I have several accounts that I use to test the site.

I logged in as a student. Everything looked fine.
I logged out.

Logged back in as the administrator.
All info in the user menu, profile, and edit profile section, showed my student account information including that accounts email address.

Then, when I click on my "Site Home", the name and information changes to my admin account. When I then go in to my profile, it shows all of the correct information.

But, then when I click on "Dashboard", that page returns all of the information to my student account information. When I go in to the profile from the menu there, it shows all of the student information again and not the admin account information.

Very weird.


In reply to Andrew Johnson

Re: Wrong user after log in

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

Could just be a very weird cache problem. But I'm still sceptical. How is the MUC set up? If you have no idea what I'm talking about then where is your 'moodledata' (the uploads file area) located? Is anything else 'odd' going on with your site - even if it seems completely unrelated?

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

Here is the config.php in the moodledata\muc folder


close.jpg
application/x-httpd-php config.php 
PHP script text
<?php defined('MOODLE_INTERNAL') || die();
 $configuration = array (
  'siteidentifier' => 'fd859ed0068cb1f4f85ad18e48fe5e77',
  'stores' => 
  array (
    'default_application' => 
    array (
      'name' => 'default_application',
      'plugin' => 'file',
      'configuration' => 
      array (
      ),
      'features' => 14,
      'modes' => 3,
      'default' => true,
      'class' => 'cachestore_file',
      'lock' => 'cachelock_file_default',
    ),
    'default_session' => 
    array (
      'name' => 'default_session',
      'plugin' => 'session',
      'configuration' => 
      array (
      ),
      'features' => 14,
      'modes' => 2,
      'default' => true,
      'class' => 'cachestore_session',
      'lock' => 'cachelock_file_default',
    ),
    'default_request' => 
    array (
      'name' => 'default_request',
      'plugin' => 'static',
      'configuration' => 
      array (
      ),
      'features' => 14,
      'modes' => 4,
      'default' => true,
      'class' => 'cachestore_static',
      'lock' => 'cachelock_file_default',
    ),
  ),
  'modemappings' => 
  array (
    0 => 
    array (
      'mode' => 4,
      'store' => 'default_request',
      'sort' => -1,
    ),
    1 => 
    array (
      'mode' => 2,
      'store' => 'default_session',
      'sort' => -1,
    ),
    2 => 
    array (
      'mode' => 1,
      'store' => 'default_application',
      'sort' => -1,
    ),
  ),
  'definitions' => 
  array (
    'core/string' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 30,
      'canuselocalstore' => true,
      'component' => 'core',
      'area' => 'string',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/langmenu' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'canuselocalstore' => true,
      'component' => 'core',
      'area' => 'langmenu',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/databasemeta' => 
    array (
      'mode' => 1,
      'requireidentifiers' => 
      array (
        0 => 'dbfamily',
      ),
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 15,
      'component' => 'core',
      'area' => 'databasemeta',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/eventinvalidation' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'requiredataguarantee' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'eventinvalidation',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/questiondata' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'requiredataguarantee' => false,
      'datasource' => 'question_finder',
      'datasourcefile' => 'question/engine/bank.php',
      'component' => 'core',
      'area' => 'questiondata',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/htmlpurifier' => 
    array (
      'mode' => 1,
      'canuselocalstore' => true,
      'component' => 'core',
      'area' => 'htmlpurifier',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/config' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'config',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/groupdata' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 2,
      'component' => 'core',
      'area' => 'groupdata',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/calendar_subscriptions' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'component' => 'core',
      'area' => 'calendar_subscriptions',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/capabilities' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 1,
      'ttl' => 3600,
      'component' => 'core',
      'area' => 'capabilities',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/yuimodules' => 
    array (
      'mode' => 1,
      'component' => 'core',
      'area' => 'yuimodules',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/observers' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 2,
      'component' => 'core',
      'area' => 'observers',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/plugin_manager' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'plugin_manager',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/coursecattree' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'invalidationevents' => 
      array (
        0 => 'changesincoursecat',
      ),
      'component' => 'core',
      'area' => 'coursecattree',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/coursecat' => 
    array (
      'mode' => 2,
      'invalidationevents' => 
      array (
        0 => 'changesincoursecat',
        1 => 'changesincourse',
      ),
      'ttl' => 600,
      'component' => 'core',
      'area' => 'coursecat',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/coursecatrecords' => 
    array (
      'mode' => 4,
      'simplekeys' => true,
      'invalidationevents' => 
      array (
        0 => 'changesincoursecat',
      ),
      'component' => 'core',
      'area' => 'coursecatrecords',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/coursecontacts' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'simplekeys' => true,
      'ttl' => 3600,
      'component' => 'core',
      'area' => 'coursecontacts',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/repositories' => 
    array (
      'mode' => 4,
      'component' => 'core',
      'area' => 'repositories',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/externalbadges' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'ttl' => 3600,
      'component' => 'core',
      'area' => 'externalbadges',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/coursemodinfo' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'canuselocalstore' => true,
      'component' => 'core',
      'area' => 'coursemodinfo',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/userselections' => 
    array (
      'mode' => 2,
      'simplekeys' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'userselections',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/completion' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'ttl' => 3600,
      'staticacceleration' => true,
      'staticaccelerationsize' => 2,
      'component' => 'core',
      'area' => 'completion',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/navigation_expandcourse' => 
    array (
      'mode' => 2,
      'simplekeys' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'navigation_expandcourse',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/suspended_userids' => 
    array (
      'mode' => 4,
      'simplekeys' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'suspended_userids',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/plugin_functions' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 5,
      'component' => 'core',
      'area' => 'plugin_functions',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/tags' => 
    array (
      'mode' => 4,
      'simplekeys' => true,
      'staticacceleration' => true,
      'component' => 'core',
      'area' => 'tags',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/grade_categories' => 
    array (
      'mode' => 2,
      'simplekeys' => true,
      'invalidationevents' => 
      array (
        0 => 'changesingradecategories',
      ),
      'component' => 'core',
      'area' => 'grade_categories',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/temp_tables' => 
    array (
      'mode' => 4,
      'simplekeys' => true,
      'simpledata' => true,
      'component' => 'core',
      'area' => 'temp_tables',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'core/tagindexbuilder' => 
    array (
      'mode' => 2,
      'simplekeys' => true,
      'simplevalues' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 10,
      'ttl' => 900,
      'invalidationevents' => 
      array (
        0 => 'resettagindexbuilder',
      ),
      'component' => 'core',
      'area' => 'tagindexbuilder',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'availability_grade/scores' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'staticaccelerationsize' => 2,
      'ttl' => 3600,
      'component' => 'availability_grade',
      'area' => 'scores',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'availability_grade/items' => 
    array (
      'mode' => 1,
      'staticacceleration' => true,
      'staticaccelerationsize' => 2,
      'ttl' => 3600,
      'component' => 'availability_grade',
      'area' => 'items',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'mod_glossary/concepts' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => false,
      'staticacceleration' => true,
      'staticaccelerationsize' => 30,
      'component' => 'mod_glossary',
      'area' => 'concepts',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'repository_skydrive/foldername' => 
    array (
      'mode' => 2,
      'component' => 'repository_skydrive',
      'area' => 'foldername',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'tool_monitor/eventsubscriptions' => 
    array (
      'mode' => 1,
      'simplekeys' => true,
      'simpledata' => true,
      'staticacceleration' => true,
      'staticaccelerationsize' => 10,
      'component' => 'tool_monitor',
      'area' => 'eventsubscriptions',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
    'tool_uploadcourse/helper' => 
    array (
      'mode' => 4,
      'component' => 'tool_uploadcourse',
      'area' => 'helper',
      'selectedsharingoption' => 2,
      'userinputsharingkey' => '',
    ),
  ),
  'definitionmappings' => 
  array (
  ),
  'locks' => 
  array (
    'cachelock_file_default' => 
    array (
      'name' => 'cachelock_file_default',
      'type' => 'cachelock_file',
      'dir' => 'filelocks',
      'default' => true,
    ),
  ),
);

In reply to Andrew Johnson

Re: Wrong user after log in

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

Actually... you can just delete that file and it will return to the default. 

You would have known about it if you'd changed the settings as you'd probably remember being confused!

Average of ratings: Useful (1)
In reply to Andrew Johnson

Re: Wrong user after log in

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hello Andrew,

this is the very first time I hear about something like that.

I also suspect some server caching problems. Do you use opcache/APC? Is your moodledata folder separate from the wwwroot and not accessible from internet?

When you experience this problem, please keep the browser window open, login to server and clear opcache/APC and then check the user info in the browser again

In reply to Marina Glancy

Re: Wrong user after log in

by Andrew Johnson -

Hi Marina,


Yes, using Apache through Hostgator.  I have to have them reset Apache since it  isn't allowed on the user end.

The moodledata folder is above the moodle root folder.   

In reply to Andrew Johnson

Re: Wrong user after log in

by Andrew Johnson -

Update

I now have an issue where I was editing a course and switched my role to "student" to see how the course looked.  When I click on "Return to my original role", I get the following error:

Incorrect sesskey submitted, form not accepted!

More information about this error

Even after logging out and back in as Admin, I can't edit anything because it says "Student" under my name.


This is really driving me crazy!


AJ

In reply to Andrew Johnson

Re: Wrong user after log in

by Andrew Johnson -

Debugging error messages:


Incorrect sesskey submitted, form not accepted!

More information about this error

×Debug info: 
Error code: invalidsesskey
×Stack trace:
  • line 495 of /lib/setuplib.php: moodle_exception thrown
  • line 85 of /lib/sessionlib.php: call to print_error()
  • line 51 of /course/switchrole.php: call to require_sesskey()

In reply to Andrew Johnson

Re: Wrong user after log in

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

Sessions are broken on your site. Wish I could tell you why sad

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

Now when I edit a course, I can see the changes in edit mode, but once I turn-off edit mode, the changes are not reflected..............

Could I need to have Hostgator reset the Apache server???

In reply to Andrew Johnson

Re: Wrong user after log in

by Robert Brenstein -
Shooting from the hip: Is it possible that you are accessing more than one Moodle instance from that computer or the same Moodle but using a different address?
In reply to Robert Brenstein

Re: Wrong user after log in

by Andrew Johnson -

Doesn't appear to be.   Different computers.  Different networks, etc.

In reply to Howard Miller

Re: Wrong user after log in

by Andrew Johnson -

Could this be a file permissions issue??  Seems that all folders in moodle and moodledata directories are 755, but some files like config.php and .htaccess are 644.





Now when I edit a course, I can see the changes in edit mode, but once I turn-off edit mode, the changes are not reflected..............

Could I need to have Hostgator reset the Apache server???

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

The following long winded explanation is somewhat a guess ... but ... might apply ...

Moodle 3.1 uses files in /moodledata/sessions/ for session info/recording.
That's IF that was not changed to DB in Session Handling.

When one logs on, there is a file created.   Looks like: sess_mcs4du10acf7usqg9l0o9265o1

the files themselves has pretty strict restrictions:
-rw-------. 1 apache apache 24947 Jul 29 13:16 sess_mcs4du10acf7usqg9l0o9265o1
only the apache user has read/write

Contained therein are settings/permissions for the user.

Settings for sessions has options:
one is timeout ... default is 2 hours.

Sessions with a Moodle create a cookie in the browser.
Using FireFox here ...

Cookie name: MoodleSession
Has content like: mcs4du10acf7usqg9l0o9265o1
which, if you look above, is the same as the session information file
in /moodledata/sessions/
In the browser it's set to expire at end of session.

Depending upon actions that session file size might actually
increase
Example: first logged on as an admin level user, the session file
was:

24947 Jul 29 13:16 sess_mcs4du10acf7usqg9l0o9265o1

after going into a course and switching users several times
AND running cron job that same file is now:

25603 Jul 29 13:33 sess_mcs4du10acf7usqg9l0o9265o1

So one could have issues with this IF one ere using the same machine
and same browser accessing the same site ... logging on as admin, then
other user with different level of access.

Clear Cookies/clear cache on workstation/browser - in/on all browsers you might have used (IE, Chrome, FireFox, other)

On the server manually remove any files found in /moodledata/sessions/
It is safe to do ... if you are logged on at the time you do that, your
next click will be directed to logging on again.

Run cron several times until there are no more 'cleanup task' or it doesn't show anything that it did.   That's OK.

When testing as the other student user, try using another browser - ie, instead of using FireFox use Chrome.   Browsers don't share cookie information nor session information.   The server, however, will use the sessions directory and a file.

'spirit of sharing', Ken

In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Thank you for the great info Ken.  I am working on all of your suggestions.  However, I'm not 100% sure how to manually run cron.  

If I try to access the cron.php file at: http://vitalsignsconference.com/server/moodle/admin/cron.php    

I get the message below.


!!! Sorry, internet access to this page has been disabled by the administrator. !!! !! Error code: cronerrorclionly !! !! Stack trace: * line 495 of /lib/setuplib.php: moodle_exception thrown * line 61 of /admin/cron.php: call to print_error() !!


Thoughts?


Thanks,

Andy

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

Just H got ya covered there with running of cron.

Something else 'discovered' ... you've WordPress in front of the Moodle.

Do you have anything setup between WordPress and your Moodle for users?

It's not un-common for WP to have re-write rules.   Sometimes apps do affect other apps.

Only by looking at web server logs one might see issues.   Can't do that in Moodle.   Must use whatever tool your provider (HostGator) might have for you in cPanel or other tool.

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Seems like the log in names are okay, right now, but getting the following errors now in debug:


parent does not exist!
  • line 913 of /lib/adminlib.php: call to debugging()
  • line 73 of /admin/settings/frontpage.php: call to admin_category->add()
  • line 7277 of /lib/adminlib.php: call to require()
  • line 19 of /admin/settings.php: call to admin_get_root()

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

Set debugging to something sane ... not insane ... like all the way to developer ... and let's see if that goes away or not.

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Using Normal debugging:


parent does not exist!
  • line 913 of /lib/adminlib.php: call to debugging()
  • line 73 of /admin/settings/frontpage.php: call to admin_category->add()
  • line 7277 of /lib/adminlib.php: call to require()
  • line 7381 of /lib/adminlib.php: call to admin_get_root()
  • line 42 of /admin/settings.php: call to admin_write_settings()

No errors coming up with session key issues, but have been receiving this today:     Error

Sorry, but your session key could not be confirmed to carry out this action. This security feature prevents against accidental or malicious execution of important functions in your name. Please make sure you really wanted to execute this function.

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

That error appeared where? how?

Plugin conflict?

See: https://moodle.org/mod/forum/discuss.php?d=14657

What additional plugins are present?

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

I received the debugging info while trying to add a file to a course folder, but also happened in other areas as well.  

The second error statement came when attempting to edit another course and editing the course description.

I'm trying to attache a pdf of the pugins, but somehow, my file uploads gat changed back to 512 max again!



In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

You don't need to upload to this forum a PDF of all of your addons/plugins.   Follow the link provided about conflicting plugin that lead to a similar error and see IF your site is using the same plugin.

First, strongly suggest putting a password on the running of cron.   See the same place where you allowed running of cron from the web for the place to set the password as well as the way to access via browser.

The error is still related to sessions.

By chance did anyone mess with roles and their permissions in Moodle?

You are runnning under linux (on shared system?) .... IF that's true, the code directory is probably in something like /home/customerlogin/public_html/ and your moodledata is in /home/customerlogin/.    moodledata has an .haccess file in it.   The customerlogin on such systems is part of the apache group ... that's how apache can serve up your stuff.

IF you are on a VPS self-managed your apache document root could be in /var/www/html/ Moodle code there

And moodledata is in /var/www/

If that's the case, you can be very liberal with permissions on everything in moodledata ... user, group, others and read and write.    That would include your customer login as well as anyone logged on to the Moodle as an admin level that should have access rights to edit/make changes.

So just about anything or all you attempt to edit gives you the error about 'parent does not exist'.

You might have to ask HostGator personnel to do this for you if you don't have command line/ssh access (you are running Linux) ... there is a php script in moodlecode/admin/cli/ called fix_course_sequence.php.

This following is what that script says:

Checks and fixes that course modules and sections reference each other correctly.

Compares DB fields course_sections.sequence and course_modules.section
checking that:
- course_sections.sequence contains each module id not more than once in the course
- for each moduleid from course_sections.sequence the field course_modules.section
  refers to the same section id (this means course_sections.sequence is more
  important if they are different)
- each module in the course is present in one of course_sections.sequence
- section sequences do not contain non-existing course modules

If there are any mismatches, the message is displayed. If --fix is specified,
the records in DB are corrected.

This script may run for a long time on big systems if called for all courses.

Avoid executing the script when another user may simultaneously edit any of the
courses being checked (recommended to run in mainenance mode).

Options:
-c, --courses         List courses that need to be checked (comma-separated
                      values or * for all). Required
-f, --fix             Fix the mismatches in DB. If not specified check only and
                      report problems to STDERR
-h, --help            Print out this help

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Working through your suggestions, but interesting you mentioned Apache.  We are currently on a shared server with Hostgator.  In the past, I have spoke to Hostgator support to reset/reboot the server so that Apache could take the changes.  Now, Hostgator is refusing to do it unless I purchase the next plan up for a dedicated server.   Could this be the issue?????

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

The scripts I shared are command line only, take apache out of the loop, but do require command line access to run.   Shared services many times do not offer ssh for customer ... FTP yes ... but not ssh.     If you do have ssh access, it's in a jail and can't use some things ... can't install git via yum to be able to put your Moodle under git updates/upgrades.

If apache needs tweaking some directives for apache can be included in an .htaccess file which is supposted to take affect immediately or upon next access to the resource.   Apache supposed to check for the existence of .htaccess.   However, on a shared server some .htaccess tweaks not allowed cause they go over the limits of the shared package that all users on a shared server are under.  A reboot of apache services affects all customers on a shared system.

But, the same sort of thing could be true of php scripts from an app talking to the database on a shared database server.   Example: changing the priv's of the DB user set up to interact with your DB for Moodle.   If a change is needed, the login doesn't have access levels enough to make those changes in some cases ... might be able to do them using a mysql global  commands but they aren't permanent - good only for as long as the MySQLdaemon/service is running.   If it reboots, goes back to defaults or parameters set by a limited access my.cnf file.

All this to say ... yes, moodle doing more ... requiring more (unoconv, search - with version 3.1) do require software not normally installed on shared servers.   Thus, if one wants those features, no choice but to go to a dedicated where you are the only customer using and have access levels enough to do what one needs to do.   That, however, is a learning curve upwards.  Not a mountain and not so steep that one couldn't learn/do, however.

Hope that explains.

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Been working with Hostgator, but I can't run the fix php file.  Keeps telling me: Command line scripts can not be executed from the web interface

Hostgator doesn't see any issues and they did upgrade my php to 5.5

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

Andrew, my friend, you are just not reading ...

Previous post shared about the scripts ... first sentence said:

"The scripts I shared are command line only, take apache out of the loop, but do require command line access to run."

Maybe I should have bolded 'require command line access to run'.

So what it's telling you is correct and proper.

Can't speak for Moodle HQ/coders ... nor can I speak for HG.   Have not had any first hand experience with HG support persons, but when 'they' say 'didn't see any issues' ... how do they know  that?   Did you provide them access to your Moodle Admin UI so they could see themselves?  (they probably wouldn't do that even if you set it up).  Yes, they probably do NOT see issues knowing your account is on a shared host with restrictions and thus it is providing to you the customer, exactly what the package said it would - but no more.   And, just maybe, you NEED more ability to do XYZ.   That's what they suggested when offering the upgrade, is it not?

This entire issue with sessions is kinda weird anyway ... very few postings about anything similar ... the one I referred to was in 2014 and about a plugin that hadn't been kept up to date, etc..

I know that users are sometimes between 'the free advisors' over here with HG technical support but what can I say.

Am not a hosting provider myself and don't work for one so I have nothing to gain by placing doubt in your mind about HG.   Then again, I have seen conversations between HG and Moodle users that I'd take exception to knowing what I do know about standalone servers that I fully manage and what HG offers.

Sooooo .... maybe somone else in these forums who host with HG can share their experiences concerning issues, package they bought, maybe even who to contact at HG to get resolutions to issues.

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Hi Ken,


Sorry about the confusion.   I was working all day on this with Hostgator.  Now, everything seems to be working correctly, and I mean everything!

Hostgator upgraded my php from version 5.4 to 5.5.  Not sure why that did it, but it did.


Thank you for giving me a lot of guidance on this.  I am a newbie, if you couldn't tell smile, and still getting used to everything.


Thanks again!!

Andy

In reply to Andrew Johnson

Re: Wrong user after log in

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

Woo Hoo!!

I think we can safely assume that something was wrong with the 5.4 install. Probably in the region of session handling. 

You've had an unpleasant experience. I hope it hasn't put you off big grin

In reply to Andrew Johnson

Re: Wrong user after log in

by Ken Task -
Picture of Particularly helpful Moodlers

Welcome!  Glad to hear it's fixed!   Did HG give you any details other than upgrading your PHP?    IF not, that's ok, am the curious type.    Howard might be right ... a PHP sessions issue ... as I understand shared hosting one or all versions of a scripting language (in this case PHP) has to be compiled on a shared host in order to provide customers with options of which version to run.

Any hooooo .... now onto actually using it! ;)

'spirit of sharing', Ken


In reply to Ken Task

Re: Wrong user after log in

by Andrew Johnson -

Yes, I believe Howard hit the nail on the head!   We were concerned about PHP session issues at the start, but then so many problems arised.

Hostgator tech support suggested upgrading the PHP to 5.5 after I explained some of the issues I was having.  He wasn't sure if that is what was causing everything or not, but it was worth a try.  I was also in the process of upgrading to a dedicated server, but will stay with the shared server for now since the problem is fixed.

Thanks again for your help and for everyone else's help as well.


Andy

In reply to Andrew Johnson

Re: Wrong user after log in

by William Michael -

Greetings,

I ran into this problem today...Problem was caused by site caching in our Sucuri firewall.  Turned off site caching and problem was solved instantly.  Note it was not a hosting service issue, but a security cloud proxy issue.  

William Michael
Classical Liberal Arts Academy
North Carolina, USA