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

Check who is log in

Hi,

I need to write application which tell me
who is login. In example:
1. login as Shamrock
2. I see Shamrock login
3. someone login as Morbious
4. They both see : Shamrock & Morbious
5. Shamrock logout
6. Morbious refresh site and see only Morbious is logged
Any sugesstions ?
Best regards,

Shamrock
Jul 17 '05 #1
4 1924
I noticed that Message-ID: <42*********************@mamut2.aster.pl>
from Shamrock contained the following:
1. login as Shamrock
2. I see Shamrock login
3. someone login as Morbious
4. They both see : Shamrock & Morbious
5. Shamrock logout
6. Morbious refresh site and see only Morbious is logged
Any sugesstions ?


You need to store the login information in a file or database. Change
the database when someone logs out (or after n minutes of inactivity).
--
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 #2
>I need to write application which tell me
who is login. In example:
1. login as Shamrock
2. I see Shamrock login
3. someone login as Morbious
4. They both see : Shamrock & Morbious
5. Shamrock logout
6. Morbious refresh site and see only Morbious is logged
Any sugesstions ?


Browsers don't log out. Users rarely log out (if you provide a
link to log out and the login is protecting sufficiently sensitive
information, a few of your users MIGHT use it).

The closest you can usually get is to (a) decide that a person is
logged out if the last page refresh is older than X time, and (b)
process explicit logouts if someone actually uses them.

Put the login info in a database. If they refresh a page, update
the last_refreshed_timestamp. To see who is logged in, select the
entries with a login name and whose last_refreshed_timestamp is
later than, say, an hour ago.

Gordon L. Burditt
Jul 17 '05 #3
Q: How to find the logged in users?
Q: How to find the number of logged in users?

A: If you use session based authentication/login mechanism, it is quite
easy when you use custom-DB-based session--so that the session
variables will be stored in database instead of default files. As the
session will be available in the database table, it is easy to query
it/count the number of sessions or records.

Refer:
http://www.php.net/session_set_save_handler
http://www.code.dearneighbor.com/db_esession.html

+++
@todo Cleanup. Better link to DB handler

Jul 17 '05 #4
"Shamrock" <Sh******@anywhatyou.want> wrote in message
news:42*********************@mamut2.aster.pl...
Hi,

I need to write application which tell me
who is login. In example:
1. login as Shamrock
2. I see Shamrock login
3. someone login as Morbious
4. They both see : Shamrock & Morbious
5. Shamrock logout
6. Morbious refresh site and see only Morbious is logged
Any sugesstions ?
Best regards,

Shamrock


A very simple way to do this is to glob the session save path, obtainable
through ini_get(). Session files have names of the form "sess_<session_id>".
Cut off the prefix and load each session by calling session_id(),
session_start(), and session_write_close(). Be sure to save a copy of the
current $_SESSION first.

The downside to this method is that on a share server, you will end up
reading the sessions of other web sites as well. There are ways to get
around the problem though.
Jul 17 '05 #5

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

Similar topics

17
by: Craig Bailey | last post by:
Someone please explain what alternate universe I fell into this afternoon when PHP started telling me that 2 doesn't equal 2. Not sure about you, but when I run this, it tells me 59001.31 doesn't...
2
by: Askari | last post by:
Hi, How do for do a "select()" on a CheckButton in a menu (make with add_checkbutton(....) )? I can modify title, state, etc but not the "check state". :-( Askari
2
by: Edward | last post by:
The following html / javascript code produces a simple form with check boxes. There is also a checkbox that 'checks all' form checkboxes hotmail style: <html> <head> <title></title> </head>...
7
by: Tony Johnson | last post by:
Can you make a check box very big? It seems like when you drag it bigger the little check is still the same size. Thank you, *** Sent via Developersdex http://www.developersdex.com ***...
2
by: Travis.Box | last post by:
I have an MS Access userform with 16 Check Boxes. Each of the checkboxes has a different option value, which coincides with the Check Box name (eg. cb01.OptionValue = 1). At the bottom of the...
1
by: scprosportsman | last post by:
Please help guys, i am trying to set up a database here at work and im fairly new to access in terms of writing functions and queries and stuff. I have 2 different places on my design that will...
2
by: Chris Davoli | last post by:
How do you enable a check box in the GridView. I selected Checkbox Field in the Columns of the GridView, and the check box shows up in the Grid view, but it is disabled. How do I enable it so I can...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
5
by: starke1120 | last post by:
Im creating a check in – check out database for RF guns. I have a table that contains models. ID (primary key) Model A table that contains Gun Details ID (primary key) Model_id...
1
by: ghjk | last post by:
my php page has 7 check boxes. I stored checked values to database and retrive as binary values. This is the result array Array ( => 0 => 1 => 0 => 1 => 0 => 0 => 1 ) 1 means checked....
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: 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...
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
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.