I will describe here step by step what I did, you or the others can try and check if there is an error of mine in that:
step 1: login.php page
- I have created a "login.php" page, a simple page with a form on it with 2 fields (username & password) and a submit button.
- Then I've added to it your Mysqli Login User behavior with these settings on the General panel:
Login name: myloginone
Trigger Button: submit pressed
Success redirect: menu.php
Return to restrict page: not checked
Failure Redirect: login-denied.php
Table: table_name
(set also Find Record & Stored values (MM_Username) panels
step 2: menu.php page
- I've created the "menu.php" page, a simple white page with <h1> MENU </h1>
- Then I've added to it the Restrict Access To Page Behavior with these settings:
Trigger: before page load
Authentication: myloginone
Failed Redirect: not-authorized.php
step 3: Duplicated "menu.php" and renamed the duplacated version in "any-restricted-page.php" . Changed h1 to <h1> ANY RESTRICTED PAGE </h1>
step 4: Created a simple "login-denied.php" and a "not-authorized.php" page
In this environment Login works fine: if you insert a right username/password combination you will be redirected to the "menu.php" page. From here you can navigate to the "any-restricted-page.php" and back to "menu.php" page. (if not, you will be redirected to "login-denied.php")
I have also set up the Logout function. So, now let's log out and try in a browser the URL of the "menu.php" and the "any-restricted-page.php", like this:
https://www.mysite.com/rs-area/any-restricted-page.php -> it works fine and I get the "not-authorized.php" page
https://www.mysite.com/rs-area/menu.php -> I get a Server Error that exactly says this: (I copied&pasted it from the browser changed only my sites relevant) :
"....
Warning: Cannot modify header information - headers already sent by (output started at /home/sth/mysite.com/rs-area/menu.php:3) in /home/sth/mysite.com/webassist/mysqli/authentication.php on line 206
...."
And in that line in your /webassist/mysqli/authentication.php you can read:
"... header("location: " . $this->addQuerystring($url)); ..."
-------------------------------
I have the same settings in DW CS6 on its Deprecated Server Behavior and there I haven't got this error: "menu.php" and all the other restricted pages go to the "not-authorized.php" page if I'm not logged in and insert their URLs in a browser.