Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Sessions - User Did Not Logoff Properly

Status
Not open for further replies.

drh2

Technical User
Joined
Jan 7, 2002
Messages
4
Location
US
We have a PHP script on our server downloaded from PHP Resource Index and it has been working fine for months. Yesterday the program seemed to hangup on the login script. I used phpMyAdmin and found the user table had not been closed properly, so I repaired it, optimized it. I restarted MySQL but still cannot get to the login screen.

I don't know that much about PHP (as you can probably tell), but I've scanned the login script and found it uses PHP Sessions. I'm thinking a user must not have logged out properly and thus the session_destroy() didn't run. Would that cause this problem?

When I use phpinfo() I find that session.name has a value of PHPSESSID and HTTP_COOKIE has a value of PHPSESSID=866...etc. Is there anything I need to do to clear that cookie? Your help is very much appreciated!!
 
Inspect the session settings in the phpinfo();
All parameters for life-time and garbage collection are explained here:


I do not believe that a good PHP script should require the user to logoff. It should handle the termination of a session according to the phpini settings. A termination can be caused by service interruption etc. and needs to be expected and handled.

It may be something within the downloaded script that causes the error.

BTW, there's no mention what the error actually is.
 
Thanks for your help! I'll check out that link.

I'm not getting an error, just that the browser says for three minutes or so that it's opening the login page and then finally goes to "Page Cannot Be Displayed" in my browser (IE 6.0). While it says it's opening the page, though, I don't see data transferring on my connection. Besides that, I don't know where to find any logs on the server that might show me an error.

I agree that the script should not require a logoff, and I'm sure this user wasn't the first to not logoff properly for all the time we've been running the script. The MySQL database was up to 140MB, so that might've had something to do with it. I cleaned up the database and optimized all the tables in phpMyAdmin (which I can do because they are MyISAM tables), but still the login hangs. The program is Popper webmail.

Thank you again.

 
Questions:
1. Do you host somewhere or do you have your own machine?
2. If own machine, what kind of OS?
3. Did you try a different browser, Mozilla? Netscape? How do they behave?

 
1. We have our own machine; we're a local ISP and webhost.
2. The server is RedHat Linux 7.2, MySQL 3.23, PHP 4.0.6
3. I just tried it in Netscape 7 and the same thing happened. The browser hangs when trying to go to the login screen. I can start out at the index.php page, but index.php?login=Login... is the one that's not opening.
 
I assume you are using the Apache webserver.

Since you administer your own server I would troubleshoot the problem using PHP error logging:

Check the settings for error logging by phpinfo();
I'd enable the error_log to inspect what is happening. The PHP documentation tells all about the error logging options:

Also, I'd check the webserver log and see what happened to the HTTP request.

And, eventually, I'd upgrade PHP to a more recent version than 4.0.6.
 
Yes, Apache 1.3.20. I appreciate the information. I haven't found anything connected to this problem in the webserver access and error logs, but I will study the PHP doc you gave and update this thread when I have a solution. Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top