Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Strange Session problems
Old 07-30-2008, 06:49 PM Strange Session problems
VirtuosiMedia's Avatar
Web Design Made Simple

Posts: 1,228
Trades: 0
Edit: I think I've figured it out. I made a mistake with the generation of my hash that allowed for potential matches, though not very often. I fixed it and it seems to be working.

I'm a little at a loss. I'm developing a site for someone else that involves user registration, login, etc. I have set up the login system that has the following process.

It checks to see if the user email address and password are on file and match and gets a user id.
It generates a unique hash and updates a user sessions table in the DB where the user id matches the one returned above.
The hash is set in the $_SESSION array.

Each page will then check for $_SESSION['hash']. If it exists, it will get the corresponding user data and display the username, else it will display a login bar.

My problem is that the above works, but only most of the time. On occasion, it will display the wrong username when you login. I haven't been able to replicate the error consistently enough to isolate it because it works correctly most of the time.

I don't have much control over the server environment, but I suspect that it might have some part to play in the error. It's using PHP 4.4.2. Has anyone ever run into something similar? Are there any session settings that might cause a similar error? Any insight would be invaluable. I can post code or other info if needed.
__________________
Want new web resources every day? - Follow me on
Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Last edited by VirtuosiMedia; 07-30-2008 at 08:38 PM..
VirtuosiMedia is offline
Reply With Quote
View Public Profile Visit VirtuosiMedia's homepage!
 
 
Register now for full access!
Reply     « Reply to Strange Session problems
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12993 seconds with 12 queries