diff options
Diffstat (limited to 'docs/examples/cookie_interface.c')
-rw-r--r-- | docs/examples/cookie_interface.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/examples/cookie_interface.c b/docs/examples/cookie_interface.c index 32e9a1d1e..9168247cf 100644 --- a/docs/examples/cookie_interface.c +++ b/docs/examples/cookie_interface.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms - * are also available at https://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -69,7 +69,7 @@ main(void) curl_global_init(CURL_GLOBAL_ALL); curl = curl_easy_init(); if(curl) { - char nline[256]; + char nline[512]; curl_easy_setopt(curl, CURLOPT_URL, "https://www.example.com/"); curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); @@ -93,9 +93,9 @@ main(void) #define snprintf _snprintf #endif /* Netscape format cookie */ - snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%lu\t%s\t%s", + snprintf(nline, sizeof(nline), "%s\t%s\t%s\t%s\t%.0f\t%s\t%s", ".example.com", "TRUE", "/", "FALSE", - (unsigned long)time(NULL) + 31337UL, + difftime(time(NULL) + 31337, (time_t)0), "PREF", "hello example, i like you very much!"); res = curl_easy_setopt(curl, CURLOPT_COOKIELIST, nline); if(res != CURLE_OK) { @@ -104,7 +104,7 @@ main(void) return 1; } - /* HTTP-header style cookie. If you use the Set-Cookie format and don't + /* HTTP-header style cookie. If you use the Set-Cookie format and do not specify a domain then the cookie is sent for any domain and will not be modified, likely not what you intended. Starting in 7.43.0 any-domain cookies will not be exported either. For more information refer to the |