/    Sign up×
Community /Pin to ProfileBookmark

Browser Close Event !

I want to catch brower closing events from clients so that i can send a request to server to invalidate clients Sessions on the close operation.
How can i do that ? ?
somthing like: :rolleyes:
Body onClose=”window.open( ‘invalidate.jsp’ );”
???
any helps would be appriciated ?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliSep 26.2003 — I don't think that will work( or you ca ncount on that solution).

What happens is when a onclose/onunload event is triggered,it does not give any time for browser to execute any other commands.

I see you are using Java,what you can do is keep the session timeout time to a general time limit that will solve this issue
Copy linkTweet thisAlerts:
@cup_of_javaauthorSep 27.2003 — I use 10 min for my session timeout. That's Ok.

but since in this system, There would be just one login with any Username, ( ie: system won't accept a logged on username ) and this prevents dual-login.

when somebody ( with any fault or ... ) closes his window, he should wait for 10 min to re-login to system.

i want this event to invalidate the session. ?

i hope i'd clarify the main problem.
Copy linkTweet thisAlerts:
@Khalid_AliSep 27.2003 — It may sound,not very nice, but to make a solution thats dependable you will have to ask your users to click a button to logout on the page(sending an explicit request to the server to invalidate the session object)
×

Success!

Help @cup_of_java spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...