By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

Session+cookies expiration

P: n/a
Hi,
I just started to use/learn php session and cookies. Everything looks fine,
I took a quick look at the php session man pages but there's two little
things that I can't figure out completely.

1- A simple page to see what happens behind the scene:
<?
session_start();
$_SESSION['TEST'] = "This is a test";
phpinfo();
?>

Session config looks like this:
session.cache_expire = 30
session.cookie_lifetime = 1800
session.gc_maxlifetime = 1440

phpinfo() show the following HTTP Response Headers :
Set-Cookie: PHPSESSID=sgkddlmuepiksd48pq1tmj38s0; expires=Sat, 21-May-2005
10:38:41 GMT; path=/
[Which is ok ... cookie will expire in 30 minutes (1800 seconds)]
EXPIRES: Thu, 19 Nov 1981 08:52:00 GMT
This is the one I don't understand, what is it, where does this value come
from? And it's always the same exact date/time. ?!?

2- The session files in D:\TEMP are not removed. I thought that those files
would be removed after some time (maybe I'm just not patient enough).

If anyone could tell more about this or point me to documentation relevant
to one of these questions I would appreciate.

Thanks
Dae

Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Daedalus.OS wrote:
EXPIRES: Thu, 19 Nov 1981 08:52:00 GMT
This is the one I don't understand, what is it, where does this value
come from? And it's always the same exact date/time. ?!?


This field controls the caching behaviour of the browser. The value PHP
sends by default (19th of Nov, 1981) ensures that the page will not be
cached by the browser and will be retrieved from the server each time it's
requested.

More info: http://www.w3.org/Protocols/rfc2616/....html#sec14.21
JW

Jul 17 '05 #2

P: n/a
Thanks a lot for the rfc link ... I wasn't shure if it was related to the
page or to cookies.

What about the session file in the temp folder ... isn't it supposed to be
removed automatically after a while ? And if so, is this time interval
configurable ? I thought it was the garbage collector but maybe I'm wrong.
Maybe it's another only-on-windows issue ... I'll try it on my freebsd box.

Dae
"Janwillem Borleffs" <jw@jwscripts.com> wrote in message
news:42***********************@news.euronet.nl...
Daedalus.OS wrote:
EXPIRES: Thu, 19 Nov 1981 08:52:00 GMT
This is the one I don't understand, what is it, where does this value
come from? And it's always the same exact date/time. ?!?


This field controls the caching behaviour of the browser. The value PHP
sends by default (19th of Nov, 1981) ensures that the page will not be
cached by the browser and will be retrieved from the server each time it's
requested.

More info: http://www.w3.org/Protocols/rfc2616/....html#sec14.21
JW

Jul 17 '05 #3

P: n/a
Daedalus.OS wrote:
What about the session file in the temp folder ... isn't it supposed
to be removed automatically after a while ? And if so, is this time
interval configurable ? I thought it was the garbage collector but
maybe I'm wrong. Maybe it's another only-on-windows issue ... I'll
try it on my freebsd box.


It's very common that session files aren't cleaned up by PHP. Personally I
use a cronjob to take care of this once a week.
JW

Jul 17 '05 #4

P: n/a
Janwillem Borleffs wrote:
<snip>
It's very common that session files aren't cleaned up by PHP. Personally I use a cronjob to take care of this once a week.

Mostly it has to do with your gc setting
<http://in.php.net/session#ini.session.gc-divisor> Since, you'll be the
only person who make requests, it will be hard for the gc to be called.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #5

P: n/a
Thanks a lot guys ...

Dae
"R. Rajesh Jeba Anbiah" <ng**********@rediffmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Janwillem Borleffs wrote:
<snip>
It's very common that session files aren't cleaned up by PHP.

Personally I
use a cronjob to take care of this once a week.

Mostly it has to do with your gc setting
<http://in.php.net/session#ini.session.gc-divisor> Since, you'll be the
only person who make requests, it will be hard for the gc to be called.

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.