...

View Full Version : problem of closing window and session



bhakti_thakkar
12-24-2007, 07:00 AM
Hi all,
i have a page [index.htm] from which i am provinding a link for the login page of application. it opens in a popup[index.php]. all application windows open in this popup. every thing is working absolutely fine. i have a link for logout which on click destroys session and closes the popup. that also works fine but i also want to close index.htm. how will it? :rolleyes:

Thanks

shyam
12-24-2007, 09:25 AM
usually u cannot close a browser window that was opened by the user using javascript, u can however close any browser windows that were opened via javascript subsequently. as always there is a workaround that will work in IE and safari (doesn't fool firefox though..)...by setting the window.opener value to any not null value IE/Safari are fooled into thinking that the browser window was opened by a script and hence allow you to close it using javascript

bhakti_thakkar
12-24-2007, 11:19 AM
hi Shyam,
my problem is, when the user clicks on logout, the session doesnt seem to be fully unset() or destroyed. if the user directly types any page url in the address bar of IE it takes the last session values and allows the user to login which is wrong. what exactly should i do? or where am i going wrong

Code of Logout.php



<?
include('include.php');
$table_name = 'LoginHistory_T';
$table_values = array(
'LogoutDate_DT' => date('d-M-y h:i:s A')
);
$sth = $db->autoExecute($table_name, $table_values,DB_AUTOQUERY_UPDATE , " user_id = '$suserid' and session_id='$session_id' ");
//PrintUpdate($table_name , $table_values , "User_ID = '$suserid' and Session_ID='$session_id' ");
session_destroy();
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> Redirecting ... </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<meta http-equiv="refresh" content="3; URL=<?=$homepath?>">
</HEAD>
<style>
.table{border-color:#687DBE;border-style:solid;border-width:1;}
</style>
<BODY>
<BR><BR><BR><BR>
<center>
<TABLE width="60%" cellpadding=5 cellspacing=2>
<tr>
<td bgcolor="#687DBE" height="30"> <font color=white><b>Redirecting...<b></font></td>
<TR>
<TD class=table height="200" align=center>Clearing cache.... Clearing cookies .... Clearing session .... <br><br>
You will be automatically redirected to the login page....<br><br>
<A HREF="<?=$homepath?>">Click here if your browser does not automatically redirect you</A>

</TD>
</TR>
</TABLE>
</BODY>
</HTML>




Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum