View Full Version : Help-Logout Feature

05-28-2009, 02:33 PM
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.

<script language="JavaScript" type="text/javascript">
function closewindow()
var anotherwindow=window.open("http://www.ip.com/ef3.html")
self.opener = this;
self.close() }

<a href="JavaScript: closewindow()">Log Out</a>


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.

05-28-2009, 05:37 PM

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.

05-29-2009, 10:57 AM
The page is authenticated using htaccess of apache server. can anybody suggest a method for adding logout feature?

06-01-2009, 12:21 PM
It would be a great help if some one can help me to sort out this.

06-01-2009, 01:24 PM
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.