Terminating .htaccess secure session

  peabody 20:46 04 Oct 2006

I have created a secure area for a user to use a .php page to amend a MySQL db, the area being protected via .htaccess.

I notice that, unless the browser is closed, the session remains alive. This could be dangerous if they leave the browser open and the wrong fingers get to work.

How can I:
a) have an Exit link that closes the .htaccess session (i.e. they would have to log in again to get at the page)
b) have an Exit link that closes the browser window and thus terminates the .htaccess session?

Thanks - hope I've explained the question OK!

  ade.h 23:19 04 Oct 2006

The first option could perhaps be done with javascript and/or cookies, though I'm no expert in that field, but the second option is an absolute no-no from the viewpoints of useability and accessibility standards.

  peabody 09:35 05 Oct 2006

Thanks. Option 2 isn't a problem in my view: it's just an admin area used by 2 people to update details on a database. Joe Public never goes anywhere near the page - they don't even know it exists! The security aspect overrides any slight accessibility issue on in this situation.

  ade.h 15:15 05 Oct 2006

Ah, I see. An intranet is a different scenario altogether - it would be perfectly okay then. It also puts a slightly different perspective on the first option - you could quite easily force the window to close with js and provide a warning that it will happen. And presumably, you are in the useful position of being able to set their browsers to delete history, cache and cookies on closure.

  peabody 15:45 05 Oct 2006

Is there a java script around that might achieve what I want - to terminate the browser session etc?? Ta.

  ade.h 15:50 05 Oct 2006

I'll have a look.

  peabody 18:25 06 Oct 2006

input type="button" value="Exit" onclick="window.close();" />

Thanks for your help, ade.h

  ade.h 18:41 06 Oct 2006

Hi, sorry for forgetting to get back to you. You found what I was going to suggest anyway, although I was ideally looking for an event trigger that would negate the need for an exit button.

  peabody 18:08 07 Oct 2006

no worries!

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Fujitsu Lifebook P727 laptop review

Best of the Grad Shows 2017: University of the West of England (UWE)

Best value Mac: Which is the best £1249 Mac to buy

Les meilleures GoPro 2017