Forum Moderators: rogerd

Message Too Old, No Replies

Login issues

Some users can't login for some reason

         

test1

4:15 pm on Sep 19, 2008 (gmt 0)

10+ Year Member



Hey guys. I'm having an issue with my login system and I have no idea what it could be. Basically I'm getting reports from some users that they simply cannont login to my site at all. But then if they send me their login information I can login just fine with it. It's only a very small minority that are having this problem but it is a problem none the less. Here is a basic description of how the login form system works.

I have a login form that people fill out, the form is checked with javascript to make sure everything is filled out, then it sends an an ajax request to a php function that actually checks the login against the database. The php queries the mysql database to see if someone with that username has that password and if it returns a result then the login is a success. This goes back to the form and lets the user know wether they have logged in or not.

I realize that I haven't added the actual code here but it's very basic and there is too much code to add here. I'm just wondering if anyone has had a similar problem or any ideas on what would cause an issue like this.

It doesn't seem to be a browser specific issue because they can try on multiple browsers and it still won't work for them. Sometimes it will suddenly start working for the user as well which makes the issue even more confusing.

Any ideas on what this could be or at least a suggestion for debugging it? So far I can't find something that is in common for all the users having this issue but perhaps I'm asking the wrong questions.

Thanks.

rogerd

4:08 pm on Sep 20, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Often these kinds of issues can be related to the user's cookie settings. The first thing to check is to be sure that the user isn't blocking cookies.

AOL browsers seem prone to login and other issues, although it sounds like your problem affects other browsers.

test1

7:36 pm on Sep 22, 2008 (gmt 0)

10+ Year Member



Thanks for the advice. I thought it might be something to do with cookies but I've checked with everyone having the issue and they say that they do have cookies enabled. Most of them are using firefox as well but some have tried ie also.

It really seams like something is happening in between the form and the data that ends up in the php script because it is acting like the user is entering the incorrect information. Is there something with the XMLHttpRequest that would cause it to act differently for different users?

rocknbil

10:27 pm on Sep 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First, if a page doesn't validate (has coding errors,) in spite of what you see, forms DO fail. I've seen it happen. So validate all page output.

Otherwise, there is only **one** way I know of to get to the root of these kinds of problems.

Log all user input. You're doing that anyway to head off potential spammers and hackers, right? :-)

I mean in your recipient scripts, log raw user data, IP, time, Every input field, everything you can think of, one line or section per submit. Before read/parse, before anything, open a file, dump the input, close the file. Server logs don't tell the whole story and are often cryptic. But if your script opens a private file and writes user input, every time any form is submitted, you can view it to compare user's problems with your log.

Also it's a good idea to script in a "rollover" size - that is,

if (logfile > 200000) { overwrite; }
else { append; }

200K is a lot of text, but if the problem goes away and you don't do this, eventually you'll have a log file eating up your entire domain.

I've had people call clients to complain their order form is broken. When I look in the log, I often see "Declined" or "invalid credit card number" or a reply from my scripts, "email or password mismatch." (The CC messages are RESPONSES from the CC gateway.)