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 5 of 5
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    34
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Help-Logout Feature

    Hi All,

    I am trying to implement a log out feature, which closes the current page and opens a new session. Since the webpage is authenticated, user need to provide the username and password. I have written the following code for it.
    The problem is that it is not closing the page but opens the new page with out asking for the username and password. The web page is uploaded on apache server. I tried this code on a test basis. But it is giving a warning before closing. I also want to avoid that also. Can anyone suggest any method to resolve this issue. It would be a great help.

    Code:
    <script language="JavaScript" type="text/javascript"> 
    <!-- 
    function closewindow() 
    { 
    var anotherwindow=window.open("http://www.ip.com/ef3.html")
    self.opener = this; 
    self.close() } 
    //-->
     </script>
    Code:
    <a href="JavaScript: closewindow()">Log Out</a>
    Scenario

    Login to http://www.ip.com/ef3.html
    ef3.html has two frames on which one is index.htmland the other one is home.html. i want to add logout feature on index.html upon clicking closes the session and opens ef3.html again.

  • #2
    Regular Coder mic2100's Avatar
    Join Date
    Feb 2006
    Location
    Scunthorpe
    Posts
    562
    Thanks
    15
    Thanked 28 Times in 27 Posts
    hi,

    how is this authenticated? if u are authenticating it using a server side language (PHP, ASP, CFM etc), u will need a script that runs to remove the sessions. This must be done or anyother page that checks for the session will still find it and the user will be authenticated.

    u may also have problems closing ur IE window depending on how the windows was created and the current security setting in the browser.

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    34
    Thanks
    4
    Thanked 0 Times in 0 Posts
    The page is authenticated using htaccess of apache server. can anybody suggest a method for adding logout feature?

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    34
    Thanks
    4
    Thanked 0 Times in 0 Posts
    It would be a great help if some one can help me to sort out this.

  • #5
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    As far as I know, when using http authentication via htaccess, the only way to logout is to close the browser, and by that I mean ending the whole process, so opening another window/tab and then closing the current one won't do.

    So, as already stated, you will have to use a server side language for authentication in order to gain more control over the authentication process.


  •  

    Posting Permissions

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