NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started 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.
-
"try and delete after timeout deletes session"
> try just before the session is deleted.
-
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
-
that's the right place - WebHandler, DeleteSession -
just make sure you do it before the parent call.
cheers
Bruce
-
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
-
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
-
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.
-
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
-
Hi Bruce,
willit be because my application is been dll been hosted on the mutisite site host program?
-
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