I have seen in this site that you can find out wether the person is online or offline or if he is online on which page he is ? How can I do that for my site ?
12 1401
I have seen in this site that you can find out wether the person is online or offline or if he is online on which page he is ? How can I do that for my site ?
I don't know about this site, but if you have to do something like this. - Make a table, say current_activities, in the database with three fields, user_id, status and last_activity.
- When a user logs on to your site, update the status field.
- Every time a user visits a page, you may be doing a cookie validation thing. While you do that, update the last_activity field.
- And when a user logs out of your site, turn off the status flag.
Thats what I can suggest. Actual algorithm may be something else.
I don't know about this site, but if you have to do something like this.- Make a table, say current_activities, in the database with three fields, user_id, status and last_activity.
- When a user logs on to your site, update the status field.
- Every time a user visits a page, you may be doing a cookie validation thing. While you do that, update the last_activity field.
- And when a user logs out of your site, turn off the status flag.
Thats what I can suggest. Actual algorithm may be something else.
That's good logic, and exactrly how i'd go about it.
But what if the user doesn't log out and just exists the browser?
You'd be smart to take the time of the users last activity, and when showing a page which shows said users last activity, check this time in your database with the current time, and if it is greater than, say, 1hour, declare the user offline and update the status accordingly.
That's good logic, and exactrly how i'd go about it.
But what if the user doesn't log out and just exists the browser?
You'd be smart to take the time of the users last activity, and when showing a page which shows said users last activity, check this time in your database with the current time, and if it is greater than, say, 1hour, declare the user offline and update the status accordingly.
Yeah, you are right :)
Actually I didn't think about in deep. :p
Then we can also do one change. Instead of status flag, use time only. Don't update the status field with YES or NO, but update it with time. After one hour (or how much required), if user not logged out, declare him logged out. Else if he actually logs out, clear the time.
Yeah, you are right :)
Actually I didn't think about in deep. :p
Then we can also do one change. Instead of status flag, use time only. Don't update the status field with YES or NO, but update it with time. After one hour (or how much required), if user not logged out, declare him logged out. Else if he actually logs out, clear the time.
Indeedy, doody.
See what we can do when we work together?
It's beautiful!
Indeedy, doody.
See what we can do when we work together?
It's beautiful!
Yeah, it is...
PS: What's doody?
Yeah, it is...
PS: What's doody?
Urm, well... it just rhymes :D
Urm, well... it just rhymes :D
oh... ok.. thats goody doody!
oh... ok.. thats goody doody!
This thread has officially been h i j a c k e d
:P
Thats the third thread hijak that i've witnessed in two days!
Thats the third thread hijak that i've witnessed in two days!
I know, and the first one was mine!!
So taking revenge here. :D
Thats the third thread hijak that i've witnessed in two days!
You better watch it!
Or we'll be hijacking you
*evil*
Could we please all get back to the problem here?
moderator
Sign in to post your reply or Sign up for a free account.
Similar topics
by: SeC |
last post by:
Hi.
Is there any way to detect if application is being killed by 'End
Process' via Task Manager ?
|
by: dE|_ |
last post by:
I have started looking into scripts for screen size detect with the
intention of using them to pick from a number of CSS style sheets tailored
to the size.
Is there a good reason why this is not...
|
by: sebastian |
last post by:
Can this be done without client-side scripting? I thought sessions
might be the answer but after some testing found that sometimes the
old session data remained even after the user left the site...
|
by: Peter |
last post by:
Hello
I have an UTF string, how can i detect what language it is?
thanks
from Peter (cmk128@hotmail.com)
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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: 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: 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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
| |