Sessions: httpd.conf vs. php.ini

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
mkotzev
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 8:29 pm

Sessions: httpd.conf vs. php.ini

Post by mkotzev »

While I've been coding for a few months now, I'm still relatively new to PHP and its configurations. I am building a site which uses sessions, and was wondering what the behavior is for Session Timeout. Apache 2's httpd.conf file has the Timeout directive, but PHP5's php.ini has the session.gc_maxlifetime configuration.

If Apache is set to timeout after 1800 seconds and PHP is set to, say, 1400 seconds, when would the session actually timeout?

Thanks!
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Sessions: httpd.conf vs. php.ini

Post by VladSun »

Apache timeout config option has nothing to do with PHP session management:

http://httpd.apache.org/docs/1.3/mod/core.html#timeout
TimeOut directive
Syntax: TimeOut number
Default: TimeOut 300
Context: server config
Status: core

The TimeOut directive currently defines the amount of time Apache will wait for three things:
The total amount of time it takes to receive a GET request.
The amount of time between receipt of TCP packets on a POST or PUT request.
The amount of time between ACKs on transmissions of TCP packets in responses.
There are 10 types of people in this world, those who understand binary and those who don't
mkotzev
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 8:29 pm

Re: Sessions: httpd.conf vs. php.ini

Post by mkotzev »

I was misinformed then. Bummer.

So then can I assume there are no Apache directives which will interfere with PHP's session config?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Sessions: httpd.conf vs. php.ini

Post by VladSun »

mkotzev wrote:I was misinformed then. Bummer.

So then can I assume there are no Apache directives which will interfere with PHP's session config?
Yes.

PS: Would you mind telling me where you are from?
There are 10 types of people in this world, those who understand binary and those who don't
mkotzev
Forum Newbie
Posts: 3
Joined: Wed Jan 14, 2009 8:29 pm

Re: Sessions: httpd.conf vs. php.ini

Post by mkotzev »

Born in Sofia like you, live in Berkeley, California
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Sessions: httpd.conf vs. php.ini

Post by VladSun »

mkotzev wrote:Born in Sofia like you, live in Berkeley, California
:)
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply