Page 1 of 1

Logout object

Posted: Wed Apr 26, 2017 2:25 am
by alex4orly
Tried now to use the Logout Object.

I have a PHP page with the DBTS CSV List object by Navaldesign. The report works fine, but I am protecting the page with the Page Protect object and I want users to click the Logout button to get out when they finish viewing the report.

When they click the logout button, it takes them out from the report back to be presented with the Password page protect form, it doesn't!
I redirected it to the previous page, but if a user clicks to get back to the report, they can get in without the need to go through the password screen

Any idea?

Re: Logout object

Posted: Wed Apr 26, 2017 6:39 am
by Pablo
Maybe there is invalid code at the start of the page?

Note that logout is nothing more than clearing the session variable.

Re: Logout object

Posted: Wed Apr 26, 2017 8:33 am
by alex4orly
I didn't add any manual code to the page
Maybe the problem is that I added the Logout object onto the bottom of the same page where the DBTS CSV List object is located

If that is allowed, then I don't know what else to do

Re: Logout object

Posted: Wed Apr 26, 2017 8:46 am
by Pablo
I do not know what code is generated the 'DBTS CSV List' object'.
But there may be a conflict in the code.

Re: Logout object

Posted: Thu Apr 27, 2017 5:22 am
by Navaldesign
You should NOT use the Page Protect object. The DBTS CSV list already allows you to set protection ( B. Page Accessibility, -> >Allowed Access -> 2. Logged users).

You can NOT use the logout object in the same page as the "logout" object code destroys the session and the user will not be able to view the list.
You can use a button to link to another page and place the following code in the Start of Page of this other page:

<?php

if (session_id() == "")
{
session_start();
}
unset($_SESSION['username']);
unset($_SESSION['password']);
header ("Location: redirectpage.php");
exit;

?>

where redirectpage.php (or whatever else) is the page where you want to redirect after logging out.