When I am open the browser again after closing it with my site in admin logged-in mode it again show me in logged as admin instead of guest. Doing the same thing in IE on Windows works fine. This issue is noticed only on Mac on Safari browser. I have tried workaround by killing the session using java script by using “onbeforeunload” event but this causing another problem that when I am refreshing the page or move to other pages on the site it gets logged out. Refresh event 116 of javascript is also not working on safari.
Code I have written is something like this:
function checkKeycode(e) {
var keycode;
if (window.event)
keycode = window.event.keyCode;
else if (e)
keycode = e.which;
if (keycode == 116) {
isClose = true;
}
}
Can any body tell me solution of this problem, that how to kill the session on client side using javascript, so that next time when I launch my site on safari braowser it show me as guest not as admin.
You are probably closing the last Safari browser window but not quitting the browser. Closing the last window will exit most applications on Windows, but not on OS X. You need to explicitly quit though the menus, ⌘+q, right clicking on the icon in the dock, etc. (Session cookies are deleted when the browser is quit.)