blob: bd1a6745e132592026eabe0334a9b56162e73a72 [file] [log] [blame]
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07001.\" **************************************************************************
2.\" * _ _ ____ _
3.\" * Project ___| | | | _ \| |
4.\" * / __| | | | |_) | |
5.\" * | (__| |_| | _ <| |___
6.\" * \___|\___/|_| \_\_____|
7.\" *
Elliott Hughes82be86d2017-09-20 17:00:17 -07008.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -07009.\" *
10.\" * This software is licensed as described in the file COPYING, which
11.\" * you should have received as part of this distribution. The terms
Alex Deymo8f1a2142016-06-28 14:49:26 -070012.\" * are also available at https://curl.haxx.se/docs/copyright.html.
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070013.\" *
14.\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15.\" * copies of the Software, and permit persons to whom the Software is
16.\" * furnished to do so, under the terms of the COPYING file.
17.\" *
18.\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19.\" * KIND, either express or implied.
20.\" *
21.\" **************************************************************************
22.\"
Elliott Hughes1ef06ba2018-05-30 15:43:58 -070023.TH CURLOPT_COOKIESESSION 3 "May 05, 2017" "libcurl 7.60.0" "curl_easy_setopt options"
Elliott Hughes82be86d2017-09-20 17:00:17 -070024
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070025.SH NAME
26CURLOPT_COOKIESESSION \- start a new cookie session
27.SH SYNOPSIS
28#include <curl/curl.h>
29
30CURLcode curl_easy_setopt(CURL *handle, CURLOPT_COOKIESESSION, long init);
31.SH DESCRIPTION
32Pass a long set to 1 to mark this as a new cookie "session". It will force
33libcurl to ignore all cookies it is about to load that are "session cookies"
34from the previous session. By default, libcurl always stores and loads all
35cookies, independent if they are session cookies or not. Session cookies are
36cookies without expiry date and they are meant to be alive and existing for
37this "session" only.
38
39A "session" is usually defined in browser land for as long as you have your
40browser up, more or less.
41.SH DEFAULT
420
43.SH PROTOCOLS
44HTTP
45.SH EXAMPLE
Elliott Hughes82be86d2017-09-20 17:00:17 -070046.nf
47CURL *curl = curl_easy_init();
48if(curl) {
49 curl_easy_setopt(curl, CURLOPT_URL, "http://example.com/foo.bin");
50
51 /* new "session", don't load session cookies */
52 curl_easy_setopt(curl, CURLOPT_COOKIESESSION, 1L);
53
54 /* get the (non session) cookies from this file */
55 curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "/tmp/cookies.txt");
56
57 ret = curl_easy_perform(curl);
58
59 curl_easy_cleanup(curl);
60}
61.fi
Bertrand SIMONNETe6cd7382015-07-01 15:39:44 -070062.SH AVAILABILITY
63Along with HTTP
64.SH RETURN VALUE
65Returns CURLE_OK
66.SH "SEE ALSO"
67.BR CURLOPT_COOKIEFILE "(3), " CURLOPT_COOKIE "(3), "