File: delete-cookie.2gg

package info (click to toggle)
golf 601.4.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: ansic: 20,020; sh: 1,171; makefile: 292
file content (49 lines) | stat: -rw-r--r-- 1,658 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
delete-cookie \-  (cookies)
.SH PURPOSE
Deletes a cookie.

.SH SYNTAX

.RS 4
.EX

delete-cookie <cookie name> [ path <cookie path> ] [ status <status> ] [ secure <secure> ]

.EE
.RE

.SH DESCRIPTION
delete-cookie marks a cookie named <cookie name> for deletion, so it is sent back in the reply telling the client (such as browser) to delete it. 

Newer client implementations require a cookie deletion to use a secure context if the cookie is considered secure, and it is recommended to use "secure" clause to delete such a cookie. This is the case when either "secure" clause is used without boolean variable <secure>, or if <secure> evaluates to true.

<cookie name> is a cookie that was either received from the client as a part of the request, or was added with \fBset-cookie\fP. 

A cookie can be deleted before or after header is sent out (see \fBout-header\fP). However a cookie must be deleted prior to outputting any actual response (such as with \fBoutput-statement\fP or \fBprint-out\fP for example), or the request will error out (see \fBerror-handling\fP).

<status> (in "status" clause) is a number that will be GG_ERR_EXIST if the cookie did not exist, or GG_OKAY if it did.

The same cookie name may be stored under different URL paths. You can use "path" clause to specify <cookie path> to ensure the desired cookie is deleted. 

.SH EXAMPLES

.RS 4
.EX

delete-cookie "my_cookie"
set-bool is_secure = true
delete-cookie "my_cookie" path "/path" secure is_secure

.EE
.RE

.SH SEE ALSO
 Cookies

\fBdelete-cookie\fP  
\fBget-cookie\fP  
\fBset-cookie\fP   
See all 
\fBdocumentation\fP