Authentication not redirecting to page with "Page Access" defined
I need to re-open a previously (accidentally) closed support ticket #106696
Below is the content I provided in the posting and the reply.
**********************************
I have 2 sets of working pages that were built last year, and both are working flawlessly -- last week I needed to create a new set of pages that connect to the a new table in the same database as the working pages, and for some reason the when I try to login using the new login page, it will not redirect to the new "protected" page. It seems that the session cookie is not being set properly and it redirects to the page defined in the "If access denied, go to:" field.
I also tried taking one of the working sets of pages and verified that the redirect was working, and then simply changed the "table" reference in the code, to the new table within the same database, and it stopped working.
I can "register" with no problem, the information is added the to the database but when I try to "Login" it will not grant access to the page with the "grant access if" code on it.
If I take the "grant access if code off of the page I am trying to protect, I can redirect to it, and I can view my profile info, and I can log out -- but if that "grant access if" code is on the page it will not work, and keeps bouncing back to the "if access denied, go to:"
page.
Here is the URL for the live LogIn page as well as the code above the html:
url= rapdownloads_LogIn.php
<?php require_once( 'Connections/conn_upstart.php' ); ?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?><?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMePWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if (isset($_POST["LogIn"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if($_SERVER["REQUEST_METHOD"] == "POST"){
$WA_Auth_Parameter = array(
"connection" => $conn_upstart,
"database" => $database_conn_upstart,
"tableName" => "rapdownloads",
"columns" => explode($WA_Auth_Separator,"UserName".$WA_Auth_Separator."Password"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"") ."".$WA_Auth_Separator."".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"ID"),
"sessionNames" => explode($WA_Auth_Separator,"ID"),
"successRedirect" => "rap_download_.php",
"failRedirect" => "rapdownloads_EmailPW.php",
"gotoPreviousURL" => FALSE,
"keepQueryString" => TRUE
);
WA_AuthenticateUser($WA_Auth_Parameter);
}
?>
The page I am trying to protect is:
rap_download_.php
And the code above the html on this page is:
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if (!WA_Auth_RulePasses("Logged in to rapdownloads")){
WA_Auth_RestrictAccess("rapdownloads_LogIn.php");
}
?>
Like I said, this code is exactly the same as the code on two other sets of pages that we currently use and they all work flawlessly -- so I am pulling my hair out trying to figure out why the new pages aren't working.
For your reference, the pages that ARE working can be accesses using the following URL:
upstart_download_.php
Thank you in advance -- I am going on day 5 with no resolution.