KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: SET HTTP HEADER
PRODUCT: 4D | VERSION: 6.8 | PLATFORM: Mac & Win
Published On: July 2, 2002
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

In previous versions of 4D, when the SET HTTP HEADER(header) syntax was used, the command would accept a literal text type constant as a parameter. For example, you could write:

SET HTTP HEADER("SET-COOKIE: USER="+String(Abs(Random))+"; PATH=/")

This syntax was ambiguous to the point that 4D Compiler could not resolve it. As a result, it is no longer accepted: the header parameter must be a 4D variable or field. If not, a 4D error is displayed in the Web
browser.

Using the previous example, the correct syntax is now:
C_TEXT($vTcookie)
$vTcookie:="SET-COOKIE: USER="+String(Abs(Random))+";
PATH=/"
SET HTTP HEADER($vTcookie)