NetTalk Central

Author Topic: Where/How to do house-keeping tasks?  (Read 2811 times)

JPMacDonald

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • Email
Where/How to do house-keeping tasks?
« on: November 12, 2012, 08:49:01 AM »
HI,

I have a memory table that I  keep some session specific data in and one of the fields is obviously the sessionID. To keep memory usage under control I'd like to clear entries from this table when either a user logs out or if the sesion timesout and the garbage colelctor process kicks in.

1. What embed would I use for the logout scenario?

2. For the garbage collector scenario I think I should embed in the p_web.DeleteSession method but what do I use for the sessionID being deleted? Is p_web.SessionID still the correct thing to use here or would that delete some other active sesions's entries?

Regards

Parker

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Where/How to do house-keeping tasks?
« Reply #1 on: November 12, 2012, 09:02:51 PM »
Hi Parker,

1. WebHandler, SetSessionLoggedIn method. (before parent call).

2. WebHander. DeleteSession. Before parent call. (use p_web.SessionId there

(you can never really kill another session when using a session Id. sessions Id's are very random, are not actively reused, and are pretty much unique. And by Unique I mean likely to be unique _forever_.)

Cheers
Bruce