NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on November 14, 2012, 02:06:35 PM

Title: Delete record when browse is closed
Post by: olu on November 14, 2012, 02:06:35 PM
I have a site that users have to login and when they logout a particular record as to be deleted, so i was using the session deleted to delete this record when they logout but in some suitation when they just close browser without logging out i need to delete the record and i have put a timeout on sessions and try and delete after timeout deletes session but that seems not to work . The only way is when they logout.
Please anybody on how i can solve this problem.
Title: Re: Delete record when browse is closed
Post by: kevin plummer on November 14, 2012, 02:33:21 PM
"try and delete after timeout deletes session"

> try just before the session is deleted.
Title: Re: Delete record when browse is closed
Post by: olu on November 14, 2012, 03:31:22 PM
hi kevin, which embed point do i use i have tried delete session embed point in the webhandler and that seems not to do the trick
Title: Re: Delete record when browse is closed
Post by: Bruce on November 14, 2012, 10:03:12 PM
that's the right place - WebHandler, DeleteSession -
just make sure you do it before the parent call.

cheers
Bruce
Title: Re: Delete record when browse is closed
Post by: charl99 on November 15, 2012, 03:37:09 AM
Hi,

I can confirm that when a user just Close the Browser, the record is not deleted (in my instance In-Memory files with SessionID are not cleared), even if it is before the Parent Call as per Bruce. The time-out and logging off does work.

I guess I did not bring this up before as Session ID's are anyway so Unique I am only affected by the list of 'Users Currently Online'.

[Well, let me rephrase, when you Close the Browser it does NOT happen immediately.  Ok, I checked now, as for the In-Memory driver the clean-up does happen later, I guess when the time-out happens.]

Cheers
Charl
Title: Re: Delete record when browse is closed
Post by: Bruce on November 15, 2012, 07:04:43 AM
nothing happens when the user closes the browser - that's kinda the point.

So the session times out sometime after that (15 minutes by default) and the DeleteSession method is called at that time.

cheers
Bruce
Title: Re: Delete record when browse is closed
Post by: olu on November 15, 2012, 07:43:09 AM
Hi bruce,
     I agree with Charl after the timeout time it still does not work, but from the weblog it says delete session but the delete session embed point does not trap the event that the session has been deleted. And i have put it just before the parent call, even added a message which never gets trigger unless i logout properly.
Title: Re: Delete record when browse is closed
Post by: Bruce on November 15, 2012, 11:30:44 PM
Hi Olu,

I'm not seeing the same thing mate, sorry.
I took example 1, and added the following line of code just before the parent call in the p_web.DeleteSession method;

  self._trace('IN DELETE SESSION ' & self.SessionId)

Then I set the session timeout to 1 minute (just to speed things up a bit).

Lastly I connected to the server from a browser fiddled around a bit, then just did nothing.

After a minute passed I clicked on the server window (not in the browser) just to trigger an event. (The Session cleanup requires an event, but usually there are plenty of events flowing as other people access the site.)

In debugview I got the following line;

[4296] [netTrace][thread=3] IN DELETE SESSION 7QfzKxkHRtFOYNY7XiydRQ7pjU8OZA

So I guess, if you are having a problem, I'll need to see some sort of example app.

cheers
Bruce

Title: Re: Delete record when browse is closed
Post by: olu on November 16, 2012, 09:43:15 AM
Hi Bruce,
   willit be because my application is been dll been hosted on the mutisite site host program?
Title: Re: Delete record when browse is closed
Post by: olu on December 04, 2012, 02:34:50 AM
Hi Bruce,
    Yes it works if i run the program on its own but when i run it as a dll using the multihost, in other words runing mutiple sites then it stops working