Troubleshooting User Login Problem

We are using a multi-user PHP login system (Simple,Secure PHP) on our website. It has been working perfectly for several years. Recently we added one new user who is having trouble. His account works fine on his work computer but generates a php error on his home computer. I am able to login with his account, no problem. We’ve created a new account and even tried re-purposing an existing account, all with the same results.

The error message on the web page is coming from this code:

     $('#login').click(function(){
		if($('input#username').val() == "" || $('input#password').val() == "")
		{
			$('#feedback').removeClass().addClass('error').text('Please enter a username and 
            password!').fadeIn();
			return false;
		}
		else
		{
			$('#loading').fadeIn();
			$('#feedback').hide();
			
			$.ajax
			({
				type: 'POST',
				url: 'process.php',
				dataType: 'json',
				data:
				{
					username: $('input#username').val(),
					password: $('input#password').val()
				},
				success:function(data)
				{
					$('#loading').hide();
					$('#feedback').removeClass().addClass((data.error === true) ? 
                    'error':'success').text(data.message).fadeIn();
					if(data.error === true)
					{
						// $('#memberLoginForm').fadeOut();
					}
					else
					{
						$('#memberLoginForm').fadeOut();
						$('#footer').fadeOut();
						$('.link').fadeIn();
                        location.href = 'protected.php';
					}
				},
				error:function(XMLHttpRequest,textStatus,errorThrown)
				{
					$('#loading').fadeOut();
					$('#feedback').removeClass().fadeIn().addClass('error').text('I\'m sorry but a php 
                    error triggered this, check your php log file for more information');
				}
			});
			return false;
		}
	});	 

This code is working for 99.9% of our users and even works for the problem user when he is on another pc.

Looking for some advise on how to further troubleshoot this? It seems to be a problem specific to his pc. He has taken the pc to a repair shop and they point back to the website. His home pc is running Windows 7.

I’ve looked at the php error log on our web server just after a failed attempt and I am not seeing an error message logged.

Most likely he has Javascript shut off in his browser!

EDIT: Also, which browser is he/her using? Edge has problems same as older IE’s. Have them try a different browser.

The browser’s developer tools/console probably contains relevant error information.

Just so we are clear, this is the error message he is receiving?

Correct - but I don’t see anything in the php log file for this event.

That message is in the JQuery/Javascript. Something is failing in the code you posted.
But, first, have the 1 out of a 100 client just try another browser first.
My guess is that they are using an outdated browser that either does not allow all of those
JQ/JS commands. We need more info on this first. Ask them which browser they are using and
what version number. Then, we can test this in a matching one…

1 Like

output the actual error and see whats going on:

error:function(XMLHttpRequest,textStatus,errorThrown)
1 Like

Thanks to all for suggestions and input. After a bit more troubleshooting, we determined that the problem was with their Anti-Virus/Network security application (BitDefender in this case, but don’t think it would be unique to that app). We disabled all the security services and then the code worked. We re-enabled each service one at a time until we found that it was the Network Monitor service that was generating the error. After we added WhiteList entries for the site to the app, everything has been working fine.

This is a small non-profit site that is on a low-cost shared hosting service. I’m guessing that their reputation profile is not very good, hence the WhiteList requirement.

Again, thanks to all for the help and suggestions.

Sponsor our Newsletter | Privacy Policy | Terms of Service