I have this code under the head tag of a login page.
I wonder why can't the set-cookie function do not recognize the variable? <see in the red font>
I also tried to replace it with the "tablename.fieldname" the table seems to be not available while it is available outside the Procedure output-headers? Is there a better way to implement this?
Your help will be much appreciated.. Thanx in advance
I wonder why can't the set-cookie function do not recognize the variable? <see in the red font>
I also tried to replace it with the "tablename.fieldname" the table seems to be not available while it is available outside the Procedure output-headers? Is there a better way to implement this?
Your help will be much appreciated.. Thanx in advance
Code:
If get-cookie('username_cookie') = "" AND get-value("username") <> '' then DO:
find first users where users.username = get-value("username")
and users.password = encode(get-value("password")) no-lock no-error.
IF avail users THEN do:
ASSIGN cusername = users.username.
PROCEDURE output-headers :
set-cookie("username_cookie",cusername, ?, ?, ?, ?, ?).
END PROCEDURE.
</script>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<a>Cookie is`get-cookie("username_cookie")`</a>
<script language="SpeedScript">
end.
END.