5acb95814818e27ef39242fad21fb23122b8aea4
[catagits/Gitalist.git] / local-lib5 / man / man3 / Catalyst::Plugin::Session.3pm
1 .\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.10)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 'br\}
42 .\"
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
44 .ie \n(.g .ds Aq \(aq
45 .el       .ds Aq '
46 .\"
47 .\" If the F register is turned on, we'll generate index entries on stderr for
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
49 .\" entries marked with X<> in POD.  Of course, you'll have to process the
50 .\" output yourself in some meaningful fashion.
51 .ie \nF \{\
52 .    de IX
53 .    tm Index:\\$1\t\\n%\t"\\$2"
54 ..
55 .    nr % 0
56 .    rr F
57 .\}
58 .el \{\
59 .    de IX
60 ..
61 .\}
62 .\"
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
64 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
65 .    \" fudge factors for nroff and troff
66 .if n \{\
67 .    ds #H 0
68 .    ds #V .8m
69 .    ds #F .3m
70 .    ds #[ \f1
71 .    ds #] \fP
72 .\}
73 .if t \{\
74 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
75 .    ds #V .6m
76 .    ds #F 0
77 .    ds #[ \&
78 .    ds #] \&
79 .\}
80 .    \" simple accents for nroff and troff
81 .if n \{\
82 .    ds ' \&
83 .    ds ` \&
84 .    ds ^ \&
85 .    ds , \&
86 .    ds ~ ~
87 .    ds /
88 .\}
89 .if t \{\
90 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
91 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
92 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
93 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
94 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
95 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
96 .\}
97 .    \" troff and (daisy-wheel) nroff accents
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
105 .ds ae a\h'-(\w'a'u*4/10)'e
106 .ds Ae A\h'-(\w'A'u*4/10)'E
107 .    \" corrections for vroff
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
110 .    \" for low resolution devices (crt and lpr)
111 .if \n(.H>23 .if \n(.V>19 \
112 \{\
113 .    ds : e
114 .    ds 8 ss
115 .    ds o a
116 .    ds d- d\h'-1'\(ga
117 .    ds D- D\h'-1'\(hy
118 .    ds th \o'bp'
119 .    ds Th \o'LP'
120 .    ds ae ae
121 .    ds Ae AE
122 .\}
123 .rm #[ #] #H #V #F C
124 .\" ========================================================================
125 .\"
126 .IX Title "Catalyst::Plugin::Session 3"
127 .TH Catalyst::Plugin::Session 3 "2009-11-04" "perl v5.8.7" "User Contributed Perl Documentation"
128 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
129 .\" way too many mistakes in technical documents.
130 .if n .ad l
131 .nh
132 .SH "NAME"
133 Catalyst::Plugin::Session \- Generic Session plugin \- ties together server side storage and client side state required to maintain session data.
134 .SH "SYNOPSIS"
135 .IX Header "SYNOPSIS"
136 .Vb 1
137 \&    # To get sessions to "just work", all you need to do is use these plugins:
138 \&
139 \&    use Catalyst qw/
140 \&      Session
141 \&      Session::Store::FastMmap
142 \&      Session::State::Cookie
143 \&      /;
144 \&
145 \&    # you can replace Store::FastMmap with Store::File \- both have sensible
146 \&    # default configurations (see their docs for details)
147 \&
148 \&    # more complicated backends are available for other scenarios (DBI storage,
149 \&    # etc)
150 \&
151 \&
152 \&    # after you\*(Aqve loaded the plugins you can save session data
153 \&    # For example, if you are writing a shopping cart, it could be implemented
154 \&    # like this:
155 \&
156 \&    sub add_item : Local {
157 \&        my ( $self, $c ) = @_;
158 \&
159 \&        my $item_id = $c\->req\->param("item");
160 \&
161 \&        # $c\->session is a hash ref, a bit like $c\->stash
162 \&        # the difference is that it\*(Aq preserved across requests
163 \&
164 \&        push @{ $c\->session\->{items} }, $item_id;
165 \&
166 \&        $c\->forward("MyView");
167 \&    }
168 \&
169 \&    sub display_items : Local {
170 \&        my ( $self, $c ) = @_;
171 \&
172 \&        # values in $c\->session are restored
173 \&        $c\->stash\->{items_to_display} =
174 \&          [ map { MyModel\->retrieve($_) } @{ $c\->session\->{items} } ];
175 \&
176 \&        $c\->forward("MyView");
177 \&    }
178 .Ve
179 .SH "DESCRIPTION"
180 .IX Header "DESCRIPTION"
181 The Session plugin is the base of two related parts of functionality required
182 for session management in web applications.
183 .PP
184 The first part, the State, is getting the browser to repeat back a session key,
185 so that the web application can identify the client and logically string
186 several requests together into a session.
187 .PP
188 The second part, the Store, deals with the actual storage of information about
189 the client. This data is stored so that the it may be revived for every request
190 made by the same client.
191 .PP
192 This plugin links the two pieces together.
193 .SH "RECOMENDED BACKENDS"
194 .IX Header "RECOMENDED BACKENDS"
195 .IP "Session::State::Cookie" 4
196 .IX Item "Session::State::Cookie"
197 The only really sane way to do state is using cookies.
198 .IP "Session::Store::File" 4
199 .IX Item "Session::Store::File"
200 A portable backend, based on Cache::File.
201 .IP "Session::Store::FastMmap" 4
202 .IX Item "Session::Store::FastMmap"
203 A fast and flexible backend, based on Cache::FastMmap.
204 .SH "METHODS"
205 .IX Header "METHODS"
206 .IP "sessionid" 4
207 .IX Item "sessionid"
208 An accessor for the session \s-1ID\s0 value.
209 .IP "session" 4
210 .IX Item "session"
211 Returns a hash reference that might contain unserialized values from previous
212 requests in the same session, and whose modified value will be saved for future
213 requests.
214 .Sp
215 This method will automatically create a new session and session \s-1ID\s0 if none
216 exists.
217 .Sp
218 You can also set session keys by passing a list of key/value pairs or a
219 hashref.
220 .Sp
221 .Vb 3
222 \&    $c\->session\->{foo} = "bar";      # This works.
223 \&    $c\->session(one => 1, two => 2); # And this.
224 \&    $c\->session({ answer => 42 });   # And this.
225 .Ve
226 .IP "session_expires" 4
227 .IX Item "session_expires"
228 .PD 0
229 .ie n .IP "session_expires $reset" 4
230 .el .IP "session_expires \f(CW$reset\fR" 4
231 .IX Item "session_expires $reset"
232 .PD
233 This method returns the time when the current session will expire, or 0 if
234 there is no current session. If there is a session and it already expired, it
235 will delete the session and return 0 as well.
236 .Sp
237 If the \f(CW$reset\fR parameter is true, and there is a session \s-1ID\s0 the expiry time
238 will be reset to the current time plus the time to live (see
239 \&\*(L"\s-1CONFIGURATION\s0\*(R"). This is used when creating a new session.
240 .IP "flash" 4
241 .IX Item "flash"
242 This is like Ruby on Rails' flash data structure. Think of it as a stash that
243 lasts for longer than one request, letting you redirect instead of forward.
244 .Sp
245 The flash data will be cleaned up only on requests on which actually use
246 \&\f(CW$c\fR\->flash (thus allowing multiple redirections), and the policy is to delete
247 all the keys which haven't changed since the flash data was loaded at the end
248 of every request.
249 .Sp
250 .Vb 2
251 \&    sub moose : Local {
252 \&        my ( $self, $c ) = @_;
253 \&
254 \&        $c\->flash\->{beans} = 10;
255 \&        $c\->response\->redirect( $c\->uri_for("foo") );
256 \&    }
257 \&
258 \&    sub foo : Local {
259 \&        my ( $self, $c ) = @_;
260 \&
261 \&        my $value = $c\->flash\->{beans};
262 \&
263 \&        # ...
264 \&
265 \&        $c\->response\->redirect( $c\->uri_for("bar") );
266 \&    }
267 \&
268 \&    sub bar : Local {
269 \&        my ( $self, $c ) = @_;
270 \&
271 \&        if ( exists $c\->flash\->{beans} ) { # false
272 \&
273 \&        }
274 \&    }
275 .Ve
276 .IP "clear_flash" 4
277 .IX Item "clear_flash"
278 Zap all the keys in the flash regardless of their current state.
279 .ie n .IP "keep_flash @keys" 4
280 .el .IP "keep_flash \f(CW@keys\fR" 4
281 .IX Item "keep_flash @keys"
282 If you want to keep a flash key for the next request too, even if it hasn't
283 changed, call \f(CW\*(C`keep_flash\*(C'\fR and pass in the keys as arguments.
284 .IP "delete_session \s-1REASON\s0" 4
285 .IX Item "delete_session REASON"
286 This method is used to invalidate a session. It takes an optional parameter
287 which will be saved in \f(CW\*(C`session_delete_reason\*(C'\fR if provided.
288 .Sp
289 \&\s-1NOTE:\s0 This method will \fBalso\fR delete your flash data.
290 .IP "session_delete_reason" 4
291 .IX Item "session_delete_reason"
292 This accessor contains a string with the reason a session was deleted. Possible
293 values include:
294 .RS 4
295 .IP "\(bu" 4
296 \&\f(CW\*(C`address mismatch\*(C'\fR
297 .IP "\(bu" 4
298 \&\f(CW\*(C`session expired\*(C'\fR
299 .RE
300 .RS 4
301 .RE
302 .ie n .IP "session_expire_key $key, $ttl" 4
303 .el .IP "session_expire_key \f(CW$key\fR, \f(CW$ttl\fR" 4
304 .IX Item "session_expire_key $key, $ttl"
305 Mark a key to expire at a certain time (only useful when shorter than the
306 expiry time for the whole session).
307 .Sp
308 For example:
309 .Sp
310 .Vb 1
311 \&    _\|_PACKAGE_\|_\->config(\*(AqPlugin::Session\*(Aq => { expires => 1000000000000 }); # forever
312 \&
313 \&    # later
314 \&
315 \&    $c\->session_expire_key( _\|_user => 3600 );
316 .Ve
317 .Sp
318 Will make the session data survive, but the user will still be logged out after
319 an hour.
320 .Sp
321 Note that these values are not auto extended.
322 .IP "change_session_id" 4
323 .IX Item "change_session_id"
324 By calling this method you can force a session id change while keeping all
325 session data. This method might come handy when you are paranoid about some
326 advanced variations of session fixation attack.
327 .Sp
328 If you want to prevent this session fixation scenario:
329 .Sp
330 .Vb 5
331 \&    0) let us have WebApp with anonymous and authenticated parts
332 \&    1) a hacker goes to vulnerable WebApp and gets a real sessionid,
333 \&       just by browsing anonymous part of WebApp
334 \&    2) the hacker inserts (somehow) this values into a cookie in victim\*(Aqs browser
335 \&    3) after the victim logs into WebApp the hacker can enter his/her session
336 .Ve
337 .Sp
338 you should call change_session_id in your login controller like this:
339 .Sp
340 .Vb 8
341 \&      if ($c\->authenticate( { username => $user, password => $pass } )) {
342 \&        # login OK
343 \&        $c\->change_session_id;
344 \&        ...
345 \&      } else {
346 \&        # login FAILED
347 \&        ...
348 \&      }
349 .Ve
350 .SH "INTERNAL METHODS"
351 .IX Header "INTERNAL METHODS"
352 .IP "setup" 4
353 .IX Item "setup"
354 This method is extended to also make calls to
355 \&\f(CW\*(C`check_session_plugin_requirements\*(C'\fR and \f(CW\*(C`setup_session\*(C'\fR.
356 .IP "check_session_plugin_requirements" 4
357 .IX Item "check_session_plugin_requirements"
358 This method ensures that a State and a Store plugin are also in use by the
359 application.
360 .IP "setup_session" 4
361 .IX Item "setup_session"
362 This method populates \f(CW\*(C`$c\->config(\*(AqPlugin::Session\*(Aq)\*(C'\fR with the default values
363 listed in \*(L"\s-1CONFIGURATION\s0\*(R".
364 .IP "prepare_action" 4
365 .IX Item "prepare_action"
366 This method is extended.
367 .Sp
368 Its only effect is if the (off by default) \f(CW\*(C`flash_to_stash\*(C'\fR configuration
369 parameter is on \- then it will copy the contents of the flash to the stash at
370 prepare time.
371 .IP "finalize_headers" 4
372 .IX Item "finalize_headers"
373 This method is extended and will extend the expiry time before sending
374 the response.
375 .IP "finalize_body" 4
376 .IX Item "finalize_body"
377 This method is extended and will call finalize_session before the other
378 finalize_body methods run.  Here we persist the session data if a session exists.
379 .IP "initialize_session_data" 4
380 .IX Item "initialize_session_data"
381 This method will initialize the internal structure of the session, and is
382 called by the \f(CW\*(C`session\*(C'\fR method if appropriate.
383 .IP "create_session_id" 4
384 .IX Item "create_session_id"
385 Creates a new session \s-1ID\s0 using \f(CW\*(C`generate_session_id\*(C'\fR if there is no session \s-1ID\s0
386 yet.
387 .IP "validate_session_id \s-1SID\s0" 4
388 .IX Item "validate_session_id SID"
389 Make sure a session \s-1ID\s0 is of the right format.
390 .Sp
391 This currently ensures that the session \s-1ID\s0 string is any amount of case
392 insensitive hexadecimal characters.
393 .IP "generate_session_id" 4
394 .IX Item "generate_session_id"
395 This method will return a string that can be used as a session \s-1ID\s0. It is
396 supposed to be a reasonably random string with enough bits to prevent
397 collision. It basically takes \f(CW\*(C`session_hash_seed\*(C'\fR and hashes it using \s-1SHA\-1\s0,
398 \&\s-1MD5\s0 or \s-1SHA\-256\s0, depending on the availability of these modules.
399 .IP "session_hash_seed" 4
400 .IX Item "session_hash_seed"
401 This method is actually rather internal to generate_session_id, but should be
402 overridable in case you want to provide more random data.
403 .Sp
404 Currently it returns a concatenated string which contains:
405 .RS 4
406 .IP "\(bu" 4
407 A counter
408 .IP "\(bu" 4
409 The current time
410 .IP "\(bu" 4
411 One value from \f(CW\*(C`rand\*(C'\fR.
412 .IP "\(bu" 4
413 The stringified value of a newly allocated hash reference
414 .IP "\(bu" 4
415 The stringified value of the Catalyst context object
416 .RE
417 .RS 4
418 .Sp
419 in the hopes that those combined values are entropic enough for most uses. If
420 this is not the case you can replace \f(CW\*(C`session_hash_seed\*(C'\fR with e.g.
421 .Sp
422 .Vb 6
423 \&    sub session_hash_seed {
424 \&        open my $fh, "<", "/dev/random";
425 \&        read $fh, my $bytes, 20;
426 \&        close $fh;
427 \&        return $bytes;
428 \&    }
429 .Ve
430 .Sp
431 Or even more directly, replace \f(CW\*(C`generate_session_id\*(C'\fR:
432 .Sp
433 .Vb 6
434 \&    sub generate_session_id {
435 \&        open my $fh, "<", "/dev/random";
436 \&        read $fh, my $bytes, 20;
437 \&        close $fh;
438 \&        return unpack("H*", $bytes);
439 \&    }
440 .Ve
441 .Sp
442 Also have a look at Crypt::Random and the various openssl bindings \- these
443 modules provide APIs for cryptographically secure random data.
444 .RE
445 .IP "finalize_session" 4
446 .IX Item "finalize_session"
447 Clean up the session during \f(CW\*(C`finalize\*(C'\fR.
448 .Sp
449 This clears the various accessors after saving to the store.
450 .IP "dump_these" 4
451 .IX Item "dump_these"
452 See \*(L"dump_these\*(R" in Catalyst \- ammends the session data structure to the list of
453 dumped objects if session \s-1ID\s0 is defined.
454 .IP "calculate_extended_session_expires" 4
455 .IX Item "calculate_extended_session_expires"
456 .PD 0
457 .IP "calculate_initial_session_expires" 4
458 .IX Item "calculate_initial_session_expires"
459 .IP "create_session_id_if_needed" 4
460 .IX Item "create_session_id_if_needed"
461 .IP "delete_session_id" 4
462 .IX Item "delete_session_id"
463 .IP "extend_session_expires" 4
464 .IX Item "extend_session_expires"
465 .IP "extend_session_id" 4
466 .IX Item "extend_session_id"
467 .IP "get_session_id" 4
468 .IX Item "get_session_id"
469 .IP "reset_session_expires" 4
470 .IX Item "reset_session_expires"
471 .IP "session_is_valid" 4
472 .IX Item "session_is_valid"
473 .IP "set_session_id" 4
474 .IX Item "set_session_id"
475 .PD
476 .SH "USING SESSIONS DURING PREPARE"
477 .IX Header "USING SESSIONS DURING PREPARE"
478 The earliest point in time at which you may use the session data is after
479 Catalyst::Plugin::Session's \f(CW\*(C`prepare_action\*(C'\fR has finished.
480 .PP
481 State plugins must set \f(CW$c\fR\->session \s-1ID\s0 before \f(CW\*(C`prepare_action\*(C'\fR, and during
482 \&\f(CW\*(C`prepare_action\*(C'\fR Catalyst::Plugin::Session will actually load the data from
483 the store.
484 .PP
485 .Vb 2
486 \&    sub prepare_action {
487 \&        my $c = shift;
488 \&
489 \&        # don\*(Aqt touch $c\->session yet!
490 \&
491 \&        $c\->NEXT::prepare_action( @_ );
492 \&
493 \&        $c\->session;  # this is OK
494 \&        $c\->sessionid; # this is also OK
495 \&    }
496 .Ve
497 .SH "CONFIGURATION"
498 .IX Header "CONFIGURATION"
499 .Vb 3
500 \&    $c\->config(\*(AqPlugin::Session\*(Aq => {
501 \&        expires => 1234,
502 \&    });
503 .Ve
504 .PP
505 All configuation parameters are provided in a hash reference under the
506 \&\f(CW\*(C`Plugin::Session\*(C'\fR key in the configuration hash.
507 .IP "expires" 4
508 .IX Item "expires"
509 The time-to-live of each session, expressed in seconds. Defaults to 7200 (two
510 hours).
511 .IP "verify_address" 4
512 .IX Item "verify_address"
513 When true, \f(CW\*(C`<$c\-\*(C'\fRrequest\->address>> will be checked at prepare time. If it is
514 not the same as the address that initiated the session, the session is deleted.
515 .Sp
516 Defaults to false.
517 .IP "verify_user_agent" 4
518 .IX Item "verify_user_agent"
519 When true, \f(CW\*(C`<$c\-\*(C'\fRrequest\->user_agent>> will be checked at prepare time. If it
520 is not the same as the user agent that initiated the session, the session is
521 deleted.
522 .Sp
523 Defaults to false.
524 .IP "flash_to_stash" 4
525 .IX Item "flash_to_stash"
526 This option makes it easier to have actions behave the same whether they were
527 forwarded to or redirected to. On prepare time it copies the contents of
528 \&\f(CW\*(C`flash\*(C'\fR (if any) to the stash.
529 .SH "SPECIAL KEYS"
530 .IX Header "SPECIAL KEYS"
531 The hash reference returned by \f(CW\*(C`$c\->session\*(C'\fR contains several keys which
532 are automatically set:
533 .IP "_\|_expires" 4
534 .IX Item "__expires"
535 This key no longer exists. Use \f(CW\*(C`session_expires\*(C'\fR instead.
536 .IP "_\|_updated" 4
537 .IX Item "__updated"
538 The last time a session was saved to the store.
539 .IP "_\|_created" 4
540 .IX Item "__created"
541 The time when the session was first created.
542 .IP "_\|_address" 4
543 .IX Item "__address"
544 The value of \f(CW\*(C`$c\->request\->address\*(C'\fR at the time the session was created.
545 This value is only populated if \f(CW\*(C`verify_address\*(C'\fR is true in the configuration.
546 .IP "_\|_user_agent" 4
547 .IX Item "__user_agent"
548 The value of \f(CW\*(C`$c\->request\->user_agent\*(C'\fR at the time the session was created.
549 This value is only populated if \f(CW\*(C`verify_user_agent\*(C'\fR is true in the configuration.
550 .SH "CAVEATS"
551 .IX Header "CAVEATS"
552 .SS "Round the Robin Proxies"
553 .IX Subsection "Round the Robin Proxies"
554 \&\f(CW\*(C`verify_address\*(C'\fR could make your site inaccessible to users who are behind
555 load balanced proxies. Some ISPs may give a different \s-1IP\s0 to each request by the
556 same client due to this type of proxying. If addresses are verified these
557 users' sessions cannot persist.
558 .PP
559 To let these users access your site you can either disable address verification
560 as a whole, or provide a checkbox in the login dialog that tells the server
561 that it's \s-1OK\s0 for the address of the client to change. When the server sees that
562 this box is checked it should delete the \f(CW\*(C`_\|_address\*(C'\fR special key from the
563 session hash when the hash is first created.
564 .SS "Race Conditions"
565 .IX Subsection "Race Conditions"
566 In this day and age where cleaning detergents and Dutch football (not the
567 American kind) teams roam the plains in great numbers, requests may happen
568 simultaneously. This means that there is some risk of session data being
569 overwritten, like this:
570 .IP "1." 4
571 request a starts, request b starts, with the same session \s-1ID\s0
572 .IP "2." 4
573 session data is loaded in request a
574 .IP "3." 4
575 session data is loaded in request b
576 .IP "4." 4
577 session data is changed in request a
578 .IP "5." 4
579 request a finishes, session data is updated and written to store
580 .IP "6." 4
581 request b finishes, session data is updated and written to store, overwriting
582 changes by request a
583 .PP
584 If this is a concern in your application, a soon-to-be-developed locking
585 solution is the only safe way to go. This will have a bigger overhead.
586 .PP
587 For applications where any given user is only making one request at a time this
588 plugin should be safe enough.
589 .SH "AUTHORS"
590 .IX Header "AUTHORS"
591 Andy Grundman
592 .PP
593 Christian Hansen
594 .PP
595 Yuval Kogman, \f(CW\*(C`nothingmuch@woobling.org\*(C'\fR
596 .PP
597 Sebastian Riedel
598 .PP
599 Tomas Doran (t0m) \f(CW\*(C`bobtfish@bobtfish.net\*(C'\fR (current maintainer)
600 .PP
601 Sergio Salvi
602 .PP
603 kmx \f(CW\*(C`kmx@volny.cz\*(C'\fR
604 .PP
605 Florian Ragwitz (rafl) \f(CW\*(C`rafl@debian.org\*(C'\fR
606 .PP
607 Kent Fredric (kentnl)
608 .PP
609 And countless other contributers from #catalyst. Thanks guys!
610 .SH "COPYRIGHT & LICENSE"
611 .IX Header "COPYRIGHT & LICENSE"
612 .Vb 3
613 \&    Copyright (c) 2005 the aforementioned authors. All rights
614 \&    reserved. This program is free software; you can redistribute
615 \&    it and/or modify it under the same terms as Perl itself.
616 .Ve