the way the redirect to previous url works is this:
the person visits other.php, they dont have access to it, so they are directed to the login page with a querystring variable named accesscheck that contains the page they where directed from:
if the visit director.php, the accesscheck variable will be set to that page:
when they login, the login looks for the success redirect variable, if it is set to direct to a page;
"successRedirect" => "somepage.php",
it will then go into the routine for redirecting to another page. in this routine, it looks for the accesscheck variable and if it exists, it use that variable value as the success page redirect, if not, it will use the page that is specified.
the accesscheck variable overrides the page that is set for the success redirect.
however, if the success redirect setting is left empty:
"successRedirect" => "",
it will never go into the routine for redirecting, whether the accesscheck variable has a value or not.
rely, the only thing you need to do to make sure this works as it should is to set the action of the login form to atomaticly include any querystring variables that are passed in:
action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".htmlspecialchars($_SERVER["QUERY_STRING"]):""; ?>"