I want to close the tab as well as destroy the sessions in the php.
I have this piece of code, but doesn't work well.
<?php
session_start();
session_destroy();
?>
<script language="javascript">
setTimeout("self.close();",10000)
</script>
Help through, Thanks.
Edit: It doesn't close the window as expected.
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>This is 'myWindow'</p>");
}
function closeWin()
{
myWindow.close();
}
Hope you have tried to use firefox browser to test
In firefox, You can only close window via JavaScript that have been open via a script window.open() call.
Please refer the below link
Try Internet explorer.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.