Can I change session timeout intervals?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sanjeevcis
    New Member
    • May 2007
    • 8

    Can I change session timeout intervals?

    Hi Everybody.
    The problem is... my site is redirecting to Login page when i do nothing in my page (keeping it idle) for about 20-25 mins.
    What is the Default timeout period for sessions?.
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Originally posted by sanjeevcis
    Hi Everybody.
    The problem is... my site is redirecting to Login page when i do nothing in my page (keeping it idle) for about 20-25 mins.
    What is the Default timeout period for sessions?.
    Try to find out these lines from your php.ini file. and change the value to increase the session time out.make sure to restart the machine if you need to test.

    Code:
    ; After this number of seconds, stored data will be seen as 'garbage' and
    ; cleaned up by the garbage collection process.
    session.gc_maxlifetime = 1440

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Originally posted by sanjeevcis
      What is the Default timeout period for sessions?.
      PHP does run garbage collection on session files every 1440 seconds*, so that might be why you're having difficulties. This can be changed by setting session.gc_maxl ifetime in your php.ini file.

      *this is technically an oversimplificat ion. Actually, the garbage collection process is run approximately 1% of the time whenever a page is loaded (configurable in php.ini), and it will remove all session files that have a modification date older than session.gc_maxl ifetime seconds ago.

      Comment

      • pbmods
        Recognized Expert Expert
        • Apr 2007
        • 5821

        #4
        You posted this in the PHP articles section (despite a HUMONGOUS sign that said DO NOT POST QUESTIONS HERE).

        I'm moving it to PHP forums and merging it with your cross-post.

        Comment

        • naughty123
          New Member
          • Feb 2008
          • 1

          #5
          Originally posted by sanjeevcis
          Hi Everybody.
          The problem is... my site is redirecting to Login page when i do nothing in my page (keeping it idle) for about 20-25 mins.
          What is the Default timeout period for sessions?.

          hey hieee..
          in my site i want that page should redirect to homepage when i do nothing in that page (idle) but session dosent get expired...
          can u plzz send me the logic of ur code where u get redirected to another page

          thanks

          Comment

          Working...