Hello Olaf,
Real good work (Access_User Class). You can see it working here: http://www.pre-sales.ch/html/login.php
Question: Is it possible to force a logout on leaving a protected page and if yes how?
Thanks and regards.
Hello Olaf,
Real good work (Access_User Class). You can see it working here: http://www.pre-sales.ch/html/login.php
Question: Is it possible to force a logout on leaving a protected page and if yes how?
Thanks and regards.
Hello,
great that you like this class. Why do you need this feature? (the session is closed of the user closed his window)
Hello Olaf
The protected page has some setup that directly reflects online, adding also new reccords in a database, thus I do not want to make it too trivial for the user to come back (after leaving the page) and add more and more reccords... Call it a psychological barrier and the expression of a real will, through renewed login, to add new reccords... Possible?
just destroy (unset) the session after some transaction is done
Ok, it works with: onsubmit="<?php session_start(); unset($_SESSION); $_SESSION=array(); session_destroy();?>"
I was really looking for a less destructive logout like a logout function within your classes... But it works so let it be. Thanks.
??? just put unset($_SESSION['login']) somewhere in your code, that should do the trick...
Hello Olaf
Replacing the code above (scripted action) by a sole <?php unset($_SESSION['login']);?>, does not do it for me. The protected page is a form with a SUBMIT button and when clicked, the php code is executed on page exiting. I also tried to put it in various places on the page without success.
I would do this:
if (isset($_POST)) {
// do the other form related stuff
unset($_SESSION['login'];
}
almost the same code as in the class.
or this is possible to:
if (isset($_POST)) {
// do the other form related stuff
$myclass_obj->log_out();
}You must log in to post.