# WSETCOOKIE

Updated: 7/8/2020, 5:59:18 PM
Created: 7/8/2020, 5:59:18 PM
Last Updated By: Ryan Medina
Read Time: 1 minute(s)

The WSETCOOKIE subroutine will set a cookie to be sent back to the browser.

# Command Sytax

CALL WSETCOOKIE(NAME,VALUE,EXP.DATE,EXP.TIME,PATH,DOMAIN,SECURE)
1

# Syntax Elements

NAME Name of the cookie you want to set
VALUE Value you wish to set the cookie to
EXPDATE Date you wish the cookie to expire on.  Use pick internal dates.
EXPTIME Time you wish the cookie to expire (used with EXPDATE).  Use pick internal times.
PATH Path you wish the cookie to apply to.  Use "/" for all.
DOMAIN Domain you wish the cookie to apply to.  Use "." for domain called from.
SECURE If set to "Y" then this cookie will only save on HTTPS requests.

# Example

CALL WSETCOOKIE("mycookie","value",DATE(),TIME+300,"/",".","Y")
1

# Notes

The WSETCOOKIE command basically builds a Set-Cookie header.  This function properly formats the Set-Cookie for you and understands pick date and time formats.  If you wish more control you can use the WSETHEADER and build your own Set-Cookie line.

Here is a good link on how Set-Cookie works.