473,396 Members | 2,011 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,396 software developers and data experts.

Can I at least read the session files for all sessions?

Right now, I am attempting to see how many users are "signed on" to my
system. Since this is, at best, rather tenuous in a WEB environment, I
thought to read the active session variables and see how many sessions
there were.
Nov 8 '05 #1
4 1950
On Tue, 08 Nov 2005 09:34:02 +0200, Bob Stearns <rs**********@charter.net>
wrote:
Right now, I am attempting to see how many users are "signed on" to my
system. Since this is, at best, rather tenuous in a WEB environment, I
thought to read the active session variables and see how many sessions
there were.


I'd propose to write timestamp to DB each time the registered user visit
the site's pages. Then you define the default timeout and make querry -
something like that :
SELECT COUNT(username) FROM table_name WHERE last_logged >current_time -
timeout
think this is more simple.
--
---
Exact Meta Search | Major Search Engine
http://exactsearcher.com
Nov 8 '05 #2
That won't really work since the presence of a session file doesn't
mean the session is active. Files for session that have expired stay in
the folder under garbage collection occurs. By default, PHP garbage
collects about once every 100 requests. When traffic is low (say, in
the middle of the night), dead sessions could remain for a long time.

As was suggested, it's probably easier to save the info in the database.

Nov 8 '05 #3
Chung Leong wrote:
That won't really work since the presence of a session file doesn't
mean the session is active. Files for session that have expired stay in
the folder under garbage collection occurs. By default, PHP garbage
collects about once every 100 requests. When traffic is low (say, in
the middle of the night), dead sessions could remain for a long time.

As was suggested, it's probably easier to save the info in the database.


Thanks, I'll work on that.
Nov 9 '05 #4
Berimor wrote:
On Tue, 08 Nov 2005 09:34:02 +0200, Bob Stearns
<rs**********@charter.net> wrote:
Right now, I am attempting to see how many users are "signed on" to
my system. Since this is, at best, rather tenuous in a WEB
environment, I thought to read the active session variables and see
how many sessions there were.

I'd propose to write timestamp to DB each time the registered user
visit the site's pages. Then you define the default timeout and make
querry - something like that :
SELECT COUNT(username) FROM table_name WHERE last_logged >current_time
- timeout
think this is more simple.

Thanks, I'll work on that.
Nov 9 '05 #5

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. ...
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...
9
by: Mikel Astiz | last post by:
Hi, I am looking for a simple way to detect session ends so I can update a session table. I am new to PHP and don't understand how such event can be handled, since there seems not to be a...
5
by: ASP.Confused | last post by:
As you can tell from my previous posts on this issue...I'm really confused :-/ I have a few ASP.NET web applications on my web host's "https" server. Our web host has a single "bin" folder for...
2
by: Cesar Ronchese | last post by:
Hello, I'm experiencing a very weird problem. I have a ASP.Net 2005 application (VB.Net) that creates some folders to store temporary files. example: Session_Start(...)...
9
by: Markus | last post by:
Hi In cases where I need to store the session id and/or the remote host in a database I used to choose tinytext fields so far. Anyway the usual values for session ids are of 32 characters...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
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...
3
by: maneshborase | last post by:
Hi friends, I am facing one serious problem in my application. I am trying to open dicom image file (.dcm) has size around 400 MB. But I am getting and unhandy exceptions, Some time, ...
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:
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.