I see. this is using MySQLi authentication, not security assist.
On the login page, add the following code at line 1:
<?php
@session_start;
if(isset($_GET['accesscheck'])) {
$_SESSION['WA_FAIL_login'] = $_GET['accesscheck'];
}
?>
also, since you are using mod rewrite, you wont be able to use the PHP_SELF variable in the login link, set up the link using the page name and the id URL variable:
<a href="/request-detail-<?php echo(isset($_GET['id'])?$_GET['id']:"");?>">Login</a>