I have the following function to set an administrator cookie when the rememberme button is checked:
<!--- setRememberMeCookie() Method --->
<CFFUNCTION NAME="setRememberMeCookie" ACCESS="REMOTE" RETURNTYPE="BOOLEAN" DISPLAYNAME="setRememberMeCookie" HINT="Saves user login details to cookie">
<CFARGUMENT NAME="Usuario" TYPE="STRUCT" REQUIRED="YES">
<!--- Save the struct to a cookie --->
<CFSCRIPT>
adminStrc = Arguments.Usuario;
getPageContext().getResponse().addHeader("Set-Cookie", "name=#adminStrc.Nombre#; value=#adminStrc.Valor#; SECURE=yes; Max-Age=31622400; DOMAIN=eMercado.com; path=/Cookies; httponly=true" );
</CFSCRIPT>
<CFRETURN true>
</CFFUNCTION>
I am trying to test this function with the code below:
<CFSCRIPT>
usuarioCookie = "#application.UsuarioCookie#"; //My Cookies Component
adminCookie = structNew();
adminCookie.Nombre = "Admin_Clave";
adminCookie.Valor = "2E372208-446D-57A5-07199C09B88DA458";
//To test the Cookie function
testCookie = usuarioCookie.setRememberMeCookie(adminCookie);
</CFSCRIPT>
<p><CFDUMP VAR="#testCookie#"> </p>
When I run the code I receive the following error:
Element VALOR is undefined in ADMINSTRC.
Could please let me know what I am doing wrong? Cheers.