• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Get Sessions from Application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Get Sessions from Application


  • Subject: Re: Get Sessions from Application
  • From: Guido Neitzer <email@hidden>
  • Date: Wed, 5 Sep 2007 09:29:54 -0600

On 05.09.2007, at 07:05, Daniele Corti wrote:

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 do this with a database table that tracks the current users. It's a matter of a couple of minutes to implement this:


- create a table in the database, log the session id, a time stamp, the instance, and the current user in Session.awake() (I only update a record for the session id, so I don't have many rows in that table),

- delete this row in Session.terminate(),

- call Session.terminate() when the user logs out,

- write a cleanup method that removes all entries for this instance from the db.

This works well and does not have to do dirty things in the sessionStore. Maybe I forgot something here, but that's the basic principle. And in the admin part of the application I have a page showing all entries from that table that updates automatically with an AjaxUpdateContainer - so you can set the instance to refuse new sessions, users get a message (through the PageWrapper) and you can see when they log out. You can even log there current page or whatever they are doing at the moment if you want (I only log the navigation status from ERXNavigation).

cug
_______________________________________________
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


References: 
 >Get Sessions from Application (From: "Daniele Corti" <email@hidden>)
 >Re: Get Sessions from Application (From: Mike Schrag <email@hidden>)
 >Re: Get Sessions from Application (From: "Daniele Corti" <email@hidden>)

  • Prev by Date: Re: Get Sessions from Application
  • Next by Date: Re: Get Sessions from Application
  • Previous by thread: Re: Get Sessions from Application
  • Next by thread: Re: Get Sessions from Application
  • Index(es):
    • Date
    • Thread