Hi, I coded an app in LAMP, sometimes the users gossip between them - in fact it's a technical gossip about some special cases- but after some time the session expires and the data is lost.

my questions are:

  1. what should I change in apache to the session never expires?

  2. is there another way to handle this? i mean, do you know a way to not lost the data even if the session expires?

regards

    Apache (or any other HTTP daemon) has nothing to do with sessions expiring; that's an issue to be handled between the client and PHP.

    For the client side of things, you need to make sure the session ID is being propagated from one page request to another for as long as you desire a single session to be valid (or "not timed out"). If you're using cookies to propagate this ID value, then a relevant PHP directive to consider would be session.cookie_lifetime.

    For the PHP side of things, you need to make sure that PHP's garbage collector (or "gc" for short) when randomly invoked won't consider session data as stale/expired (or "not timed out") if it hasn't been accessed for a period of time that doesn't exceed whatever you'd like to be considered as being "too old." The relevant PHP directive in this case would be session.gc_maxlifetime.

      Write a Reply...