Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post

    problem of closing window and session

    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?

    Thanks

  • #2
    Senior Coder shyam's Avatar
    Join Date
    Jul 2005
    Posts
    1,563
    Thanks
    2
    Thanked 163 Times in 160 Posts
    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
    You never have to change anything you got up in the middle of the night to write. -- Saul Bellow

  • #3
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post
    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

    PHP Code:
    <?
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •