1Dancer::Cookie(3) User Contributed Perl Documentation Dancer::Cookie(3)
2
3
4
6 Dancer::Cookie - class representing cookies
7
9 version 1.3513
10
12 use Dancer::Cookie;
13
14 my $cookie = Dancer::Cookie->new(
15 name => $cookie_name, value => $cookie_value
16 );
17
19 Dancer::Cookie provides an HTTP cookie object to work with cookies.
20
22 name
23 The cookie's name.
24
25 value
26 The cookie's value.
27
28 expires
29 The cookie's expiration date. There are several formats.
30
31 Unix epoch time like 1288817656 to mean "Wed, 03-Nov-2010 20:54:16 GMT"
32
33 A human-readable offset from the current time such as "2 hours". It
34 currently understands...
35
36 s second seconds sec secs
37 m minute minutes min mins
38 h hr hour hours
39 d day days
40 w week weeks
41 M month months
42 y year years
43
44 Months and years are currently fixed at 30 and 365 days. This may
45 change.
46
47 Anything else is used verbatim.
48
49 domain
50 The cookie's domain.
51
52 path
53 The cookie's path.
54
55 secure
56 If true, it instructs the client to only serve the cookie over secure
57 connections such as HTTPS.
58
59 http_only
60 By default cookies are created with a property named "HttpOnly", that
61 can be used for security, forcing the cookie to be used only by the
62 server (via HTTP) and not by any JavaScript code.
63
64 If your cookie is meant to be used by some JavaScript code, set this
65 attribute to 0.
66
68 new
69 Create a new Dancer::Cookie object.
70
71 You can set any attribute described in the ATTRIBUTES section above.
72
73 init
74 Runs an expiration test and sets a default path if not set.
75
76 to_header
77 Creates a proper HTTP cookie header from the content.
78
80 Dancer Core Developers
81
83 This software is copyright (c) 2010 by Alexis Sukrieh.
84
85 This is free software; you can redistribute it and/or modify it under
86 the same terms as the Perl 5 programming language system itself.
87
88
89
90perl v5.34.0 2021-07-22 Dancer::Cookie(3)