Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

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