Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4    Statistic  

CURL.SetOptionCookie

Sets the cookie for the current http transfer.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes

MBS( "CURL.SetOptionCookie"; Handle; Value { ; Encoding } )

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value The cookie string. ""
Encoding Optional
The text encoding for text parameter.
Default is UTF-8.
Possible encoding names: ANSI, Arabic-Mac, Arabic-Win, Baltic-Win, CentralEurope-Mac, ChineseSimp-Mac, ChineseSimp-Win, ChineseTrad-Mac, ChineseTrad-Win, Cyrillic-Mac, Cyrillic-Win, EasternEurope-Win, Greek-Mac, Greek-Win, Hebrew-Mac, Hebrew-Win, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-4, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9, ISO-8859-15, Korean-Johab, Korean-Mac, Korean-Win, Latin1, Mac, Native, ShiftJIS-Mac, ShiftJIS-Win, Turkish-Mac, Turkish-Win, UTF-8, DOS or Windows. Pass native to use the native encoding of the current platform.
"utf8"

Result

Returns "OK" on success.

Description

Sets the cookie for the current http transfer.
Pass a cookie string. It will be used to set a cookie in the http request. The format of the string should be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain.

If you need to set multiple cookies, you need to set them all using a single option and thus you need to concatenate them all in one single string. Set multiple cookies in one string like this: "name1=content1; name2=content2;" etc.

This option sets the cookie header explicitly in the outgoing request(s). If multiple requests are done due to authentication, followed redirections or similar, they will all get this cookie passed on.

Using this option multiple times will only make the latest string override the previous ones.

Examples

Pass 4 cookies together:

MBS( "CURL.SetOptionCookie"; $curl; "ORA_WX_SESSION="32230CEE0E940BDFA8157FEF3EB58E9CBD8A5699-3#1"; ObSSOCookie=VPAEWqhsUTbSXpHB0%3BqRDXNegpZBgeCgR1GJ3Ysou0A5%3FyUdO0ffMSHUl7fN0mg4cVonDmjnakVdoYpnigAR4mAeWUMk6sLw%3BqwSCmY1bCfxhdWcoOS4NhaifxRazpYpEywzdqQ3kRkNwRpECdBrwWdcFBCo6TROhgEufbykS%3FSYU%3FwJT%3FP95WgkCRMBkJBE2LSk%3B1F2BtBjBGDa42jFR8gK7bE0ewJ%3B1MM6vzq93scwL9NO%3BbCixrvJlGYL8fQWG%3BwewaIRRf4i3IcThDQBHg%2D%2D; JSESSIONID=EPQSsbjcndhPqEtvW8MQS8sQCGWta7QQQMi8k6eiT_EcoNB_YOqL!-166722973; ObSSOCookie=ktizpHi8mrSLizEejydmRivWZu%3BHr99%3BVh%3FTLFhIMRweTbStBfibTYNPa%3FpMErio42eAQ30r1SVrTmuTLbI9Cyh3KPAqR5x%3BPs6rQQbRfZrpThhgSuPZzRx7NI9S9gKQYmeWAKkIRETUR9XZKuU1ll7GwK4Ci0QFSwON2sU12EPvns9Y8RFNWHNsdfDpNXn4qdfDvOhP8VnnYNMjvZnq%3Fofg%3Fxd3QfOZnL2Z86riaRz4gq5IeKolxN7iWM4%3FIcYk2nMeEx4A9iRtftPFyGEBWpxxtMG6UsE2RMhLqMpV4Lg%2D"; "UTF-8" )

See also


CURL.SetOptionConnectionTimeout   -   CURL.SetOptionCookieFile

Feedback: Report problem or ask question.




Links
MBS Xojo blog