Hello,
I want to log out the user when close the browser, so i need to call the java script function when close the window.

I used the onunload and onbeforeunload event but it should call on each page navigation and page refreshing.

My necessity is,

The function should call only at the time of browser closed..that should be mainly supported in all browsers...

Kindly give the Support..
Regards
mani8php

mani8php,
for that purpose is the best way to use the cookies. It is possible to configure the cookie so that it is cleared while browser is closed (or better say reopened). This is also good for the case the browser fails down or is killed by (super-)user.

The cookies can be configured to be valid only up to specified time, and this configuration can be refreshed with any client activity. So the client, who forgot to log out is automatically logged out after a period of inactivity.

Jan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.