close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Auto Log In is not working

Thread began 8/04/2010 12:33 pm by sandy170299 | Last modified 8/04/2010 2:14 pm by Jason Byrnes | 1398 views | 7 replies |

sandy170299

Auto Log In is not working

The auto log in feature is not working for me. I have both the remember me and the auto log in check boxes, and I am checking both of them, but auto log in is NOT automatically redirecting me to the index page of my admin area. Where do I start troubleshooting?

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a copy of your login page so I can examine the code.

Sign in to reply to this post

sandy170299

<?php
if (!isset($_SESSION)) {
session_start();
}
?>
<?php require_once('../Connections/diamond.php');?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?><?php
if ((((isset($_POST["autologinoption"]))?$_POST["autologinoption"]:"") != "")) {
setcookie("AutoLoginPWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["autologinoption"]))?$_POST["autologinoption"]:"") != "")) {
setcookie("AutoLoginUN", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMePWD", "".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if ((((isset($_POST["remembermeoption"]))?$_POST["remembermeoption"]:"") != "")) {
setcookie("RememberMeUN", "".((isset($_POST["username"]))?$_POST["username"]:"") ."", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMePWD", "", time()+(60*60*24*30), "/", "", 0);
}
?><?php
if (isset($_POST["LogIn_x"]) && !isset($_POST["remembermeoption"])) {
setcookie("RememberMeUN", "", time()+(60*60*24*30), "/", "", 0);
}
?>
<?php
if(isset($_POST["LogIn_x"])){
$WA_Auth_Parameter = array(
"connection" => $diamond,
"database" => $database_diamond,
"tableName" => "users",
"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,"userID"),
"sessionNames" => explode($WA_Auth_Separator,"userID"),
"successRedirect" => "index.php",
"failRedirect" => "adminLogin.php",
"gotoPreviousURL" => TRUE,
"keepQueryString" => TRUE
);

WA_AuthenticateUser($WA_Auth_Parameter);
}
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Log In</title>
<link href="../WA_SecurityAssist/styles/Modular_Slate.css" rel="stylesheet" type="text/css" />
<link href="../WA_SecurityAssist/styles/Verdana.css" rel="stylesheet" type="text/css" />
<link href="adminMain.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
background-color: #A99A6B;
}
-->
</style></head>

<body>

<div id="LogInContainer" class="WAATK">
<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" name="WAATKLogInForm" id="WAATKLogInForm">
<h1 class="heading"><br>
diamond.com Admin Login<br>
<br>
</h1>
<table border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="WAATKDataTable">
<tr>
<th><div align="right">User name</div></th>
<td><div align="left">
<input type="text" class="WAATKTextField" name="username" value="<?php echo((isset($_COOKIE["RememberMeUN"]) && isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMeUN"]:"") ?>" />
</div></td>
</tr>
<tr>
<th><div align="right">Password</div></th>
<td><div align="left">
<input type="password" class="WAATKTextField" name="userpassword" value="<?php echo((isset($_COOKIE["RememberMePWD"]))?$_COOKIE["RememberMePWD"]:"") ?>" />
</div></td>
</tr>
<tr>
<th class="WAATKDataTableHeader"><div align="right">
<input type="checkbox" name="remembermeoption" <?php echo((isset($_COOKIE["RememberMeUN"]))?"checked":"") ?> value="1" />
</div></th>
<td class="WAATKDataTableCell"><div align="left">Remember me</div></td>
</tr>
<tr>
<th class="WAATKDataTableHeader"><div align="right">
<input type="checkbox" name="autologinoption" value="1" />
</div></th>
<td class="WAATKDataTableCell"><div align="left">Auto log in</div></td>
</tr>
</table>
<div class="WAATKButtonRow">
<input type="image" hspace="0" vspace="0" border="0" name="LogIn" id="LogIn" value="Log In" alt="Log In" src="../WA_SecurityAssist/images/Slate/Modular_login.gif" />
</div>
</form>
</div>
</body>
</html>

Sign in to reply to this post

Jason ByrnesWebAssist

for auto login to function, there needs to be a second authenticate user behavior applied to the page that will use the cookies values.


I suspect that the second authenticate user behavior was deleted, the security assist wizard will add two behaviors if the remember me and auto login options are selected.

Sign in to reply to this post

sandy170299

Okay-how do I fix this, or apply it after the fact?

Sign in to reply to this post

Jason ByrnesWebAssist

you are better off dleting the existing pages and re running the security assist wizard to have the security assist wizard apply it.

Sign in to reply to this post

sandy170299

Okay. That's what I'll do. Thanks, Jason!

Sign in to reply to this post

Jason ByrnesWebAssist

you're welcome.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...