summaryrefslogtreecommitdiff
path: root/sys/man/4/webcookies
blob: 63842e90f1d1ffa83d6bdaa5eb37132e06c2ff36 (plain)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
.TH WEBCOOKIES 4
.SH NAME
webcookies \- HTTP cookie manager
.SH SYNOPSIS
.B webcookies
[
.B -f
.I cookiefile
]
[
.B -m
.I mtpt
]
[
.B -s
.I service
]
.SH DESCRIPTION
.I Webcookies
manages a set of HTTP cookies, which are
used to associate HTTP requests with persistent state 
(such as user profiles) on many web servers.
.PP
.I Webcookies
reads
.I cookiefile
(default
.BR $home/lib/webcookies )
and mounts itself at 
.I mtpt
(default
.BR /mnt/webcookies ).
If
.I service
is specified, 
.I cookiefs
will post a service file descriptor
in
.BR /srv/\fIservice .
.PP
The cookie file contains one cookie per line;
each cookie comprises some number of
.IB attr = value
pairs.
Cookie attributes are:
.TF \fBnetscapestyle=flag
.TP
.BI name= name
The name of the cookie on the remote server.
.TP
.BI value= value
The value associated with that name on the remote server.
The actual data included when a cookie is sent back
to the server is
.IB \fR``\fIname = value\fR''
(where, confusingly,
.I name
and
.I value
are the values associated with the
.B name
and
.B value
attributes.
.TP
.BI domain= domain
The domain within which the cookie can be used.
If
.I domain
is an IP address, the cookie can only be used when
connecting to a web server at that IP address.
If
.I domain
is a pattern beginning with a dot,
the cookie can only be used for servers whose name
has
.I domain
as a suffix.
For example, a cookie with
.B domain=.bell-labs.com
may be used on the web sites
.I www.bell-labs.com
and
.IR www.research.bell-labs.com .
.TP
.BI path= path
The cookie can only be used for URLs with a path (the part after
.BI http:// hostname\fR)
beginning with
.IR path .
.TP
.BI version= version
The version of the HTTP cookie specification, specified by the server.
.TP
.BI comment= comment
A comment, specified by the server.
.TP
.BI expire= expire
The cookie expires at time
.IR expire ,
which is a decimal number of seconds since the epoch.
.TP
.B secure=1
The cookie may only be used over secure
.RB ( https )
connections.
.TP
.B explicitdomain=1
The domain associated with this cookie was set by
the server (rather than inferred from a URL).
.TP
.B explicitpath=1
The path associated with this cookie was set by the
server (rather than inferred from a URL).
.TP
.B netscapestyle=1
The server presented the cookie in ``Netscape style,'' which
does not conform to the cookie standard, RFC2109.
It is assumed that when presenting the cookie to the server,
it must be sent back in Netscape style as well.
.PD
.PP
.I Webcookies
serves a directory containing two files.
The first,
.BR cookies ,
is a textual representation of the cookie file,
which can be edited to change the set of cookies
currently held.
The second,
.BR http ,
is intended to be used by HTTP clients
to access cookies.
Upon opening
.BR http ,
the client must write a full URL to it.
After writing the URL, reading from the file will yield any
HTTP
.B Cookie:
headers that should be included in the 
request for this particular URL.
Once the request has been made, any
.B Set-Cookie:
lines in the HTTP response header should
be written to the file to save them for next time.
If
.B cookiefs
decides not to accept the cookie (as outlined in
RFC2109, section 4.3.4), no indication is given.
.PP
.IR Hget (1)
uses
.BR /mnt/webcookies/http ,
when it exists, to manage cookie state.
.I Webfs
does not (yet).
.SH SOURCE
.B /sys/src/cmd/webcookies.c
.SH SEE ALSO
.IR hget (1)
.SH BUGS
It's not clear what the relationship between
.I cookiefs
and something like
.I webfs
should be.