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

questions about sessions

Hi All,

First, just wanted to say that I found what I thought was a very helpful
tutorial on sessions in case anyone out there has questions on them:

http://www.free2code.net/tutorials/p...4/sessions.php

I've been using sessions for quite some time but only after reading this
do I really understand what is going on on both the client and server side.

Unfortunately, I still have some unanswered questions after reading it,
as it is pretty basic and gives a quick intro to sessions. For testing
purposes, I turned off all cookies in IE and attempted to sign into my
site on my local host, which uses sessions for signing in. In addition,
session.use_trans_sid = 0 in my ini file. I can't figure out how, but
somehow my scripts all still work and I am able to login fine, even
though cookies are disabled, as well as trans sid. How is my session id
being passed, as my understanding is these are the 2 possible methods?
There is no sessid propagated through the URL either, so it is not
through a get variable.

Also, I looked in my sessiondata folder and found a bunch of session
data. When I physically log out and kill a session, it removes it from
the folder. However, when I just close the browser window, it does not
remove the data from the folder. Reopening the browser right away
results in a new session and requires the user to login again, but the
old data from the previous session is still there. I checked my ini,
and found the default:

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24 minutes.

Sorry for the long post, but thanks in advance for all help!!

Marcus

Jul 17 '05 #1
10 1927
On Tue, 03 Aug 2004 17:17:35 +0000, Marcus wrote:
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24 minutes.

Isn't that 1440 seconds? Inwhich case, that's 24 hours, not mins =)

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #2
On Tue, 03 Aug 2004 20:02:14 +0000, Ian.H wrote:
On Tue, 03 Aug 2004 17:17:35 +0000, Marcus wrote:
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24 minutes.

Isn't that 1440 seconds? Inwhich case, that's 24 hours, not mins =)

Sorry, ignore my reply above.. [ makes mental note to engage brain
_before_ fingers ] it's been a long day =)

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #3
I noticed that Message-ID:
<pa****************************@bubbleboy.digiserv .net> from Ian.H
contained the following:
Isn't that 1440 seconds? Inwhich case, that's 24 hours, not mins =)

Sorry, ignore my reply above.. [ makes mental note to engage brain
_before_ fingers ] it's been a long day =)


I have to teach basic skills numeracy in September if you are
interested...<g>

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
"Marcus" <Ju********@aol.com> wrote in message
news:PM******************@newssvr28.news.prodigy.c om...
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24

minutes.

I'm been just waiting for someone to ask that one :-)

The reason why the files are still there is because PHP does not garbage
collect on every request session expiration does not happen very often. It
does it only once in a while. The chance of garbage collection being trigger
on a given request equals session.gc_probability / session.gc_divisor. If
your set both to 100, then GC happens on every request.
--
Obey the Clown - http://www.conradish.net/bobo/
Jul 17 '05 #5
On Tue, 03 Aug 2004 21:28:35 +0100, Geoff Berrow wrote:
I noticed that Message-ID:
<pa****************************@bubbleboy.digiserv .net> from Ian.H
contained the following:
Isn't that 1440 seconds? Inwhich case, that's 24 hours, not mins =)

Sorry, ignore my reply above.. [ makes mental note to engage brain
_before_ fingers ] it's been a long day =)


I have to teach basic skills numeracy in September if you are
interested...<g>

Sign me up for 2 classes Geoff! lol

Just finished my 13 hour day.. and what an eventful evening =)

Regards,

Ian

--
Ian.H
digiServ Network
London, UK
http://digiserv.net/

Jul 17 '05 #6
Chung Leong wrote:
"Marcus" <Ju********@aol.com> wrote in message
news:PM******************@newssvr28.news.prodigy.c om...
; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24


minutes.

I'm been just waiting for someone to ask that one :-)

The reason why the files are still there is because PHP does not garbage
collect on every request session expiration does not happen very often. It
does it only once in a while. The chance of garbage collection being trigger
on a given request equals session.gc_probability / session.gc_divisor. If
your set both to 100, then GC happens on every request.


I believe the default for that is 1, which I assumed to mean 100% - all
that math and stats getting my CS degree trained me to think 1 is 100%
:-) Thanks for clearing that up, I will try it out.

Anyone have any ideas on the first part of my question with how the
session even is working with cookies off and trans_sid off? Thanks as
always.

Marcus

Jul 17 '05 #7
Marcus wrote:
I believe the default for that is 1, which I assumed to mean 100% - all
that math and stats getting my CS degree trained me to think 1 is 100%
:-) Thanks for clearing that up, I will try it out.

Anyone have any ideas on the first part of my question with how the
session even is working with cookies off and trans_sid off? Thanks as
always.

Marcus


Chung,

Continuing your last post, sorry but I forgot to ask, is there an
optimal value to set it to? i.e. does garbage collecting 100% of the
time have detrimental effects like slower performance? If not, I can't
see why it wouldn't be defaulted to 100%...

Marcus

Jul 17 '05 #8
Marcus <Ju********@aol.com> wrote in message news:<PM******************@newssvr28.news.prodigy. com>...
<snip>
For testing
purposes, I turned off all cookies in IE and attempted to sign into my
site on my local host, which uses sessions for signing in. In addition,
session.use_trans_sid = 0 in my ini file. I can't figure out how, but
somehow my scripts all still work and I am able to login fine, even
though cookies are disabled, as well as trans sid.

<snip>

Not at all possible. I guess 2 reasons:
1. You didn't _actually_ disable cookies
2. Your login script is buggy

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #9
On 04 août 2004, Sir ng**********@rediffmail.com (R. Rajesh Jeba Anbiah)
claimed in news:ab*************************@posting.google.co m:
Marcus <Ju********@aol.com> wrote in message
news:<PM******************@newssvr28.news.prodigy. com>...
<snip>
For testing
purposes, I turned off all cookies in IE and attempted to sign into
my site on my local host, which uses sessions for signing in. In
addition, session.use_trans_sid = 0 in my ini file. I can't figure
out how, but somehow my scripts all still work and I am able to login
fine, even though cookies are disabled, as well as trans sid.

<snip>

Not at all possible. I guess 2 reasons:
1. You didn't _actually_ disable cookies
2. Your login script is buggy

Just create a script that call phpinfo() and watch in the variable part if
IE send cookies.
Jul 17 '05 #10
"Marcus" <Ju********@aol.com> wrote in message
news:Uj****************@newssvr28.news.prodigy.com ...
Marcus wrote:
I believe the default for that is 1, which I assumed to mean 100% - all
that math and stats getting my CS degree trained me to think 1 is 100%
:-) Thanks for clearing that up, I will try it out.

Anyone have any ideas on the first part of my question with how the
session even is working with cookies off and trans_sid off? Thanks as
always.

Marcus


Chung,

Continuing your last post, sorry but I forgot to ask, is there an
optimal value to set it to? i.e. does garbage collecting 100% of the
time have detrimental effects like slower performance? If not, I can't
see why it wouldn't be defaulted to 100%...


It slows things down a bit, but probably not by much. Then again, there's no
harm in keeping the expired session files around either. A few 100-byte
files won't kill your disk quota. And if you have hundreds of concurrent
sessions, that probably means you're getting thousands of page hits, so the
GC mechanism would be triggered often enough at the default setting.
--
Obey the Clown - http://www.conradish.net/bobo/
Jul 17 '05 #11

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

Similar topics

2
by: Rob Pridham | last post by:
I currently manage all my sessions through MySQL tables, but obviously this means database overhead for every single page. I would like to move to PHP sessions but I'm not sure they do the job. ...
5
by: Timin Uram | last post by:
Hey! Is there some sort of limit on how much one could store in a session as far as amount of data? Is it advisable to store a LOT of data in the session when a user logs in to save queries to...
2
by: bbxrider | last post by:
1. how to determine the 'progid' parameter in the /oject tag for both session and application tags, eg, <object runat="server" scope="application" id="web1" progid="web1"> </object> 2. i want...
3
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
5
by: Wescotte | last post by:
I'm currently working on desiging several web based applications that would be grouped into a larger web based menu system. However I'm not sure exactly how to go about making it as secure as...
1
by: Jim | last post by:
Hi, I have a few questions regarding the cache object: Does the cache object exist through postbacks? The cache object only exists for the current request, right? Is there a way to cache...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory†exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
3
by: tbone | last post by:
In trying to improve the throughput of a classic ASP app I wrote a few years ago, I added monitoring to the application and session start and end methods. I'm counting the total number of sessions...
3
Atli
by: Atli | last post by:
Introduction: Sessions are one of the simplest and more powerful tools in a web developers arsenal. This tool is invaluable in dynamic web page development and it is one of those things every...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.