PDA

View Full Version : Login Script Prob


zabr7
12-13-2005, 12:32 AM
When users log in (if they've cleared their cookies), they must log in twice with the same password. Is there a fix for this?

natio :: phpFox
12-13-2005, 11:12 AM
Not to sure on this, i would belive if a user clears their browser cookies it will cause problems to login. The script needs a browser to be at a "Medium" alert and accept all cookies to be able to enter in the site.

What you could do to fix this is create your site to us PHP Sessions.
First you will have to check your PHP info to see that you have "Session Support" enabled. Which i feel most people have on their hosting accounts.

If you have it enabled and would like to make the change to sessions just get back to me and i can write up a little guide on how to change a site to work with sessions.

Also note that sessions will be added to the phpFoX Portal script in the upcoming version, i belive it is when the 1.1 hits.

zabr7
12-14-2005, 11:40 AM
Yes sessions are enabled. Please help w/instructions. I'd very much appreciate it.

Thank you.

John

natio :: phpFox
12-14-2005, 02:34 PM
Hi John,

Ok great, Just follow the steps bellow and it should then work to have your site setup to work with sessions and should help if users have any login problems.
Before you edit any of the files below be sure to save them on your HD, just in case you need to restore them.

1. Open "/inc/config/config.php"

2. Look for this:
Content visible to registered users only.

3. Above that add this:
Content visible to registered users only.

4. Then look for this:
Content visible to registered users only.

5. Replace that code with this:
Content visible to registered users only.

6. Save and Close the "/inc/config.php"

7. Now open "/member/html/member_off.php"

8. Look for this:
Content visible to registered users only.

9. Above that add this code:
Content visible to registered users only.

10. Look for this if statment:
Content visible to registered users only.

11. You will have to removed that whole if statment cause you wont need to check if cookies are able to be set. Now once you take this away you will have to find
the end point of this if statment which ends with a }, so follow the next step and this should work just fine.

12. Look for:
Content visible to registered users only.
under that you should find 3 } brackets. Just remove 1 of them.

13. Save and Close the "/member/html/member_off.php"

14. Next open "/member/logout/index.php"

15. Look for this:
Content visible to registered users only.

16. Under that add this:
Content visible to registered users only.


Once these steps are done your site should now store user sessions on the server side.
If you have any problems setting this up, or if i missed something please do post.

For more info regarding sessions: http://www.php.net/session

zabr7
12-16-2005, 03:33 AM
I tried what you asked and logins stopped completely... I re-set everything, but can you take another look?

natio :: phpFox
12-18-2005, 11:17 PM
oh ok, ill take a look into and get a hold of the script and write up the changes for you and add the whole script on here so it will be easier to test out.

zabr7
12-20-2005, 01:16 AM
That would be great. Thanks Mike!

natio :: phpFox
12-21-2005, 07:50 PM
Ok, ive added the changes to the pages needed for this script.

This file is "/inc/config/config.php"
Content visible to registered users only.


This file is "/member/html/html_member_off.php"
Content visible to registered users only.


Backup and replace your files with this source to add in the session system.
Get back to me if this helped.

zabr7
12-24-2005, 04:59 AM
This seems to almost work except after making the changes you can't view member profiles. Any idea why?

natio :: phpFox
12-24-2005, 05:08 AM
hello,
ok glad it getting there.
Once you add this fix, what happens when you try to view a user profile?
Is it just a blank page or do you get the "User not found" error?

zabr7
12-24-2005, 05:04 PM
I noticed you're referencing the "install script" in the code. Since you guys did the install, I never got a copy of the install script. This may be the problem. On the other problem, nothing happens when you click the profile....

Cheers,

John

natio :: phpFox
12-25-2005, 02:58 AM
Howdy,
Yeah the install script is usually removed for security reason cause if someone runs the install script while the site is up and running it will delete and install everything from scratch. The refrence to the "install script" in the config file is to try to find the install script if you havent already installed the file.

If possible can you pm your website and if you can put the fix i added below so i can view what might be wrong, cause i would think it should work just fine cause ive tested it on my personal server and seems to be working fine. There might be a server issue stopping something from setting the sessions. Still i dont know why it wouldnt allow to view members profiles.

Well get back to me when you can and if you dont mind me to test it on your server just send me a pm and ill be more than happy to help out. :D

Happy Holidays!

zabr7
12-25-2005, 07:10 PM
I can't PM you for some reason. I tried this again, and on login, I get a blank screen. It doesn't seem like a server side problem, because when I set the code back to original, I was logged in. Should I wait for ver. 1.1?? Otherwise email me ... I'll give you server-side access...

Cheers!

John

natio :: phpFox
12-27-2005, 10:37 AM
Content visible to registered users only.

Oh ok cool, ill send you a email today or either latest 2morow once i free up some time so we can set this up. :D