473,388 Members | 1,277 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,388 software developers and data experts.

session expiration

Hi Folk

I have a site where I set a session cookie that expires in 1000 days.

As part of my script,. I create a $_SESSION["variable"].

Now, I am wondering, if the user closes their browser window and, for
example, come back to the site next week, will the session variable still be
there?

Thank you

- Nicolaas
Oct 16 '05 #1
3 1636
absolutely expired~

Oct 16 '05 #2
Depends on his cookies setting and you Session configuration (if you
session uses cookies or the query string).

If user doesn't delete cookies when his browser closes (and your
Session uses cookies) then I guess the Session would be fine.

One more thing, Session data is (generally) saved in a file under /tmp
if files there get deleted, Session variable will be gone.

Oct 16 '05 #3
Meiao wrote:
Depends on his cookies setting and you Session configuration (if you
session uses cookies or the query string).

If user doesn't delete cookies when his browser closes (and your
Session uses cookies) then I guess the Session would be fine.
No, not under standard circumstances.

The COOKIE will be fine, true, but the sessiondata will be
garbaged-collected or time-out by timestamp.
So PHP cannot restore the session and will start a new session.

PHP will clean up old sessionfiles, and PHP decides when a file is old by
using php.ini settings.
I think default is half an hour.


One more thing, Session data is (generally) saved in a file under /tmp
if files there get deleted, Session variable will be gone.


Even when they file was for some reason NOT garbage collected, PHP checks
the timestamp, and decides it is old, and will not use it.
(This can happen if you disable garbage collection by making the chances for
it happening extremely small in php.ini)

To make the original posters scenario work, you need to make sessions last
for weeks, or months or whatever.
Not really a good thing to do, resourcewise. :-)

Regards,
Erwin Moller
Oct 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Christophe Lance | last post by:
Hello, I use PHP session cookie to store an id number. I know how to set a cookie expiration date using the setcookie function, but how to set an expiration date when the cookie is created by...
3
by: Craig Storey | last post by:
I have a form where users logged in using sessions can edit articles in a WYSIWYG editor. Some of them take their time and don't like to save their work very often and occassionally the sessions...
4
by: Igor | last post by:
Is it possible to point current context's session to another active session based on a SessionID?
1
by: VB Programmer | last post by:
I know you can make cookies expire, but how about session variables? I'm basically using session for security, etc... One variable is session("LoggedOn"). If a page sits idle for 30 minuts I...
1
by: ChrisN | last post by:
Hi there, Two questions related to each other. 1. Session variables expire by defualt when not used for 20 minutes. Does "used" mean that a user has not access any session varibles in 20...
17
by: jensen bredal | last post by:
Hello, i'm struggling with a somehow badly understood session scenario. I provide acces to my pages based on form authentication using Session cookies. Som of my pages are supposed to be...
6
by: spacehopper_man | last post by:
I'm considering ditching all use of Session state in favour of Application state. This is because - from what I can work out - it will be more memory efficient for me. I have three questions:...
17
by: Riaan | last post by:
Hi guys! I have an issue that needs urgent resolution. Imagine this scenario: You have: 1 production server running Windows Server 2003, IIS6 and an instance of MSDE 2000. There is an...
13
by: Goofy | last post by:
Does anyone know how I can kill a session by session ID ? -- Goofy
15
by: sb5309 | last post by:
When one uses CAPTCHA (form with verification code), a session is required to keep the session data. In examples that I have seen on the net, I did not see a session is closed after use. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.