Re: Get Sessions from Application
Re: Get Sessions from Application
- Subject: Re: Get Sessions from Application
- From: "Daniele Corti" <email@hidden>
- Date: Wed, 5 Sep 2007 15:40:25 +0200
2007/9/5, Mike Schrag <email@hidden>:
Be very careful accessing values of a session ... Make sure you lock properly.
Well, I'm only reading them, not writing
On Sep 5, 2007, at 9:05 AM, Daniele Corti wrote:
2007/9/5, Mike Schrag <
email@hidden>:
Assuming you're not using a servlet deployment:
WOServerSessionStore sessionStore = (WOServerSessionStore) WOApplication.application().sessionStore();
NSArray sessions = sessionStore._sessions().allValues();
Thanks that's what I need!
Note that this will only return the sessions that exist within a single instance. If you are running multiple instances, you would need to check each instance. Also, SessionStore does not expose the last access time as public -- we add that to our base session subclass and touch the value in
session.awake() so you can tell if the sessions are recently used.
I don't think I will need a too accurated value, I only need to know if a variable in the Session is setted: I mean, I use an Enterprise Object GWSUser to memorize witch user is logged in in each session, so I only need to know if it there are users logged in and how many they are
I don't recall if Session has a method that tells you if its currently checked out or not, either, but you can also add a boolean check to at least see if the session is currently awake or not.
ms
On Sep 5, 2007, at 4:10 AM, Daniele Corti wrote:
Hi all,
I've a problem with my last app:
We use our app as a WebService that provide license for our products and donwload upgrades, and a Web Site for Support.
It has happen (today) that we make some changes, so shutdown the app, while someone was downloading an update.
You can easly image that our customer wasn't happy about this....
I was thinking to prepare a method in Application for searching in active session if someone is logged in, and display it in the admin panel, but I wasn't able to find out how to access to the sessions.
Is there a way to do this, or not?
I will thank you for every advices!!!!
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young _______________________________________________
Do not post admin requests to the list. They will be ignored.
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
--
Daniele Corti
AIM: S0CR4TE5
Messenger: email@hidden
--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden--
Computers are like air conditioners -- they stop working properly if you open
WINDOWS
--
What about the four lusers of the apocalypse? I nominate:
"advertising", "can't log in", "power switch" and "what backup?"
--Alistair Young
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden