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

How To check SessionID available or not?

Hi to all,

I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Please help me to overcome the problem. Looking forward to reply from
all of you.

With Regards & thanks,
Mitul Patel

Feb 27 '06 #1
5 5148
Rule #1 - you cannot close a browser window by issuing an instruction from
the server.
Rule #2 - a user does not have to use any logout mechanism that you provide,
he can simply close the browser window.

This means that the user may have finished with your application but your
application still records him as "active".

If you write your session data to a database file you can store the user_id
in each record. Then during the garbage collection on the session table you
can extract the user_id an update that record to "logged_in=FALSE" or
whatever.

--
Tony Marston

http://www.tonymarston.net

"Mitul" <pa***********@gmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
Hi to all,

I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Please help me to overcome the problem. Looking forward to reply from
all of you.

With Regards & thanks,
Mitul Patel

Feb 27 '06 #2
Following on from Mitul's message. . .
Hi to all,

I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Please help me to overcome the problem. Looking forward to reply from
all of you.

With Regards & thanks,
Mitul Patel

You can't, using HTTP, 'ping' the client.
What does that leave?

The client might send a 'heartbeat' using Javascript say once every
couple of minutes.

How could you implement this? Possibly by requesting a url for a frame.
Whatever scheme you use don't expect it to work 100% of the time.
My guess is that you need _instead_ to look /carefully/ at user
authentication.


--
PETER FOX Not the same since the bookshop idea was shelved
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Feb 27 '06 #3
Mitul wrote:
Hi to all,

I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Please help me to overcome the problem. Looking forward to reply from
all of you.

With Regards & thanks,
Mitul Patel


Hi.

AFAIK: The onlt way to implement this is by coding your own sessionhandler,
like Mitul wrote.
It is not rocketscience, but you need to study the mechanism a little first.

It boils dow to:
1) You overwite default (filebased) sessionstorage with your own, probably
databasesessionstorage.
How?
start reading here:
http://nl2.php.net/manual/en/functio...ve-handler.php

and surely this:

http://www.zend.com/zend/tut/session.php
2) Now you are in control of the session, you can easily add some extra
functionality to garbagecollection, or sess_open() or wherever you think is
the appropriate place.
Just get the userid out of the session (or store it in the table itself),
and do what you have to do with it, like setting it to not logged in.

Regards,
Erwin Moller
Feb 27 '06 #4
Mitul wrote:
Hi to all,

I am working on a site in which I need to check whether user is online
or not. If user successfully logged out then I can change status from
online to offline but if user do not logged out and close the browser
or session timeout then in both of the case I do not handle how to
change user's status from online to offline.

Please help me to overcome the problem. Looking forward to reply from
all of you.

With Regards & thanks,
Mitul Patel

I would simply just mark them as logged in. but then let their session
time out. For example, if the user has not make any requests in 10
minutes, assume they are dead.

--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Feb 28 '06 #5
This thread also deals with this issue:
http://groups.google.com/group/comp....5b3151c2964750

Feb 28 '06 #6

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

Similar topics

4
by: Patrick Paquin | last post by:
Hi, When a user of Web application makes "File - New - Window" or Ctrl+N in IE, the user obtains 2 windows IE having the same SessionId. This generates a problem when, in one Web form, we use a...
2
by: Ramon Rocha | last post by:
Dear friends, Line code bellow is returning message error: Dim strSID As String = Session.SessionID.ToString Using <%@ Page Language="VB" EnableSessionState="True" %> Exception Details:...
0
by: XML newbie: Urgent pls help! | last post by:
ok, I changed "If node.Text = "Success" " to "If Not loginDom.InnerText Is Nothing ". Now, I don't get the NullReference error but the SessionID I see on screen is concatanated one. It looks...
2
by: XML newbie: Urgent pls help! | last post by:
If I get SessionID in 1 function how do I carry that SessionID(value of this SessionID) to another function or another form within the same project
0
by: XML newbie: Urgent pls help! | last post by:
HI, I am working on VB.Net.My program connects to the remote host, once the login values are verified, it sends the SessionID. My problem is Although in "Logindom" variable( in the Auto window),...
1
by: TheDude5B | last post by:
Hi, I was wondering if it is possible to manually renew the sessionID? I have had a look around and not found anything about renewing it automatically. I was wanting to do this just to...
0
by: Ben Fidge | last post by:
Hi I've got some ASP.NET code that spins off a couple of worker threads during a button click event. These threads call a series of functions that log their activity to a text file. For some...
6
by: Ibrahim. | last post by:
When a new request is made to the server a new session id is issued to the client (a browser instance). The problem I’m facing is that session id that is already assigned to a browser instance...
11
by: kurt sune | last post by:
Does anyone know how to retrieve the current sessionId in Global.asax.ApplicationError? /k
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...
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
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,...
0
isladogs
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...

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.