473,805 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5173
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=FALS E" or
whatever.

--
Tony Marston

http://www.tonymarston.net

"Mitul" <pa***********@ gmail.com> wrote in message
news:11******** **************@ p10g2000cwp.goo glegroups.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******@eminen t.demon.co.uk.n ot.this.bit.no. html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.dem on.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
databasesession storage.
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 garbagecollecti on, 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
1855
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 variable of session to store a dataset. The fact that the user browses with 2 windows on the same application and the same session can give unexpected results. Is it possible to have Id of window which would enable to name the variable of...
2
3985
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: System.Web.HttpException: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is...
0
1272
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 like:XXXXXX=YYYYY==, but did I do wrong. Althouggh, I get the message, Satus as Success.Since, I have to use this SessionID in another click event on the same page, how do I do this.I tried, g_SessionID= loginDom.Value g_SessionID =...
2
3217
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
1502
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), I see it has child nodes, but nodes = Nothing.. Since, I need to copy the value of SessionID in my next function, how can I read the value of Node. If I do, LoginDom.InnerText, then I get"SuccessSessionID", if there is no way to get node value...
1
2748
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 cover my back when using the sessionID in a table and dont want it duplicated. so once the data is entered into the table, i want to be able to then renew the sessionID for the
0
1155
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 reason, HttpSession.Current.Session.SessionID is blank when accessed inside these threads, but works fine outside them in the main button click handler. I've looked at using ParameterizedThreadStart to pass the session ID to the thread, but this...
6
1803
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 is getting recycled for another browser instance by ASP.NET When the client request is sent to Http server, the available session id’s (that is already present in the pool) are recycled from the session pool along with the authentication cookie. ...
11
4770
by: kurt sune | last post by:
Does anyone know how to retrieve the current sessionId in Global.asax.ApplicationError? /k
0
9718
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10109
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3008
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.