PHP Default Session Timeout

Discussion in 'Scripts, 3rd Party Apps, and Programming' started by spacepir, Jan 1, 2013.

  1. spacepir

    spacepir New Member

    Hey, me again, this time I'm wondering what x10's default PHP Session timeout is, and if there's any way to change it. I don't have access to php.ini, and seeing as I'm on free hosting, I don't think I'm going to have the flexibility I require, for now.

    The reason I ask the question is: After leaving my game idle for a while, I get an SQL error when my status bar updates itself. It happens because the Session has timed out, and, well, there's no session_id to forward to the database query.

    As always, replies appreciated. :)
  2. Skizzerz

    Skizzerz Free Hosting Guru Contributors

    No, there is no way to change it. The session timeout is the default PHP value (which means PHP sessions expire when the user closes their browser). If you use PHP's session mechanism (which I personally do not recommend, as it has numerous downsides, such as the inability to load multiple pages at the same time), and desire sessions that last for how long YOU control, you need to back it with your own session mechanism.

    EDIT: Additionally, always be sure to check for an active session before issuing any session-related db queries.
    Last edited: Jan 1, 2013
  3. spacepir

    spacepir New Member

    Ok, well it seems to be expiring every half hour or so, which seems close to PHP's default. (24 mins). Does anyone have any solutions? :confused:
  4. ezadx10b

    ezadx10b New Member

    use htaccess

    #change default session name for security default is PHPSESSIONID
    php_value session.name "©$-£??!?€-FgbJJ7HCga"
    #session timeout
    php_value session.cache_expire "30"
    #for secure session only use if u have ssl
    php_flag session.cookie_secure "Off"
    • Dislike Dislike x 1
  5. freshfa2

    freshfa2 New Member

    Help i cant figure out why it wont let me edit anything in file manager keeps saying this when i wanna put a link in my site

    Your editing session has expired.
    This is usually caused by a long period of inactivity. Please re-load the page.
  6. Skizzerz

    Skizzerz Free Hosting Guru Contributors

    @ezadx10b: php_flag and php_value do not work on x10Hosting, there is no way for end users to modify the PHP configuration outside of what is allowed in ini_set().
    @freshfa2: try adjusting your browser's cookie settings or trying with a different browser. If all else fails, use FTP. The File Manager is part of cPanel, so if there are bugs with it, it is impossible for us to fix them.
  7. freshfa2

    freshfa2 New Member

    Skizzerz Thanks for the response but Ive tried every browser and still nothing even used a different Computer at my local library and still nothing

Share This Page