Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts

    PHP/Apache Session

    I am having a problem with apache 2.2 and php 5, while the script is in use it will automatically logout a user while they are using it. This as only happened since i changed the server from apache 2 to apache 2.2. Is there any problems that i should be aware of. I have looked in the session variable section in the PHP.ini file but all the setting are the same as they were before. The variables are set so that the session shouldn't timeout until the browser is closed and this isn't the case.

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If i recall correctly apache needs to be restarted for the settings to take effect.
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)

  • #3
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,079
    Thanks
    2
    Thanked 320 Times in 312 Posts
    You need to define what you mean by - "automatically logout a user while they are using it."

    What condition in your code is being tested to determine if someone is logged in? A session variable? Just the existence of a session ID?... What have you done to debug this in your code, such as echoing the value of variables/session data? Any error messages? Any errors in the server log file?

    Also, describe the conditions that this occurs under. Are they browsing between pages? Do they refresh a page? Is it time based (they are just on one page, perhaps entering something in a form?)

    Is this on a busy site with a lot of session_start() statements? If so, the garbage_collection settings will also cause "old" session data files to be deleted, which will cause the "automatic logout" symptom that you have given.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #4
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    they are using session variables that store their usernames, these are set when the user logs in. What they are doing is calling people and after about 20 calls the users get a blank page, upon refreshing this they are taken back to the login page.

    the user is passing between several pages when this happens upon entering a call result they have to set job notes, callback date and time (if one) and after that it navigates to the next call page.

    I have looked into the garbage collection and set this so that it is disabled and it had no effect.

    I hope this is now a bit clearer, i am really confused about this????

  • #5
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    i have checked all the session variables and none of them are changing.

    more S**t hits the fan oooopps.

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,079
    Thanks
    2
    Thanked 320 Times in 312 Posts
    There are only two ways to disable garbage_collection - use the "subdirectory option" for the save_path and install your own custom session handler that has no "gc" function.

    Have you done either of these and confirmed that they are actually in effect?

    Perhaps if you post the actual session settings that are output from a phpinfo(); statement?
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #7
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    i have sorted this problem now doing the easiest thing possible, re-installing the old version of apache that i was using before the upgrade. Thanks for your help anyway.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •