473,394 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Session+cookies expiration

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
5 1736
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tom | last post by:
Hi, I would like to use the standard PHP sessions and I understand they rely on the target web browser to support session cookies. I have tried the following code: <? session_start(); if...
2
by: Theo | last post by:
Hi all Looked around on the net for an answer to a question and havent found it yet. Im learning to use sessions for authentication. So far so good. Learned how to set variables, session...
6
by: Brian Burgess | last post by:
Hi all, Anyone know how to send ASP Session cookies like the following: 'Set-Cookie: ASPSESSIONIDCSBRSDCT=IOLJEPNDANEDGDFGPEKLNGEA; path=/' using WinInet? thanks in advance... -BB
2
by: M P | last post by:
Does anybody know the default session expiration?
6
by: Nicolae Fieraru | last post by:
Hi All, I recently discovered that my session cookies on the web host disappear within 30 seconds. I created some very simple asp scripts (it took me a while until I discovered why my shopping...
3
by: Nicolae Fieraru | last post by:
Hi All, I have a lot of problems with the web site www.ggsurf.com.au I host on www.gnxonline.com and I want to find out if it is my own problem or theirs. I try to use session cookies and it...
11
by: Jennifer | last post by:
Is there a way to check for to see if the user has session cookies enabled? I know how to check to see if they have cookies in general enabled, but how do you test for just session cookies? ...
0
by: ASP Developer | last post by:
Is there a way to optimize session cookies so that they actually survive between different asp.net pages. I am finding that asp.net forgets my session cookies every time I go to different pages. ...
3
by: Jim Carlock | last post by:
I have a problem where session cookies get left inside the temporary folder. Is this a common problem or is there perhaps something I've over looked - there a way to make sure the session...
2
by: StanB | last post by:
I came across this weird problem: 1. Session state stops working after the app is deployed to another server because IE does not accept cookies. 2. It works if cookieless="true" in the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.