[Catalyst] [Patch] Remove address mismatch warnings when using only $c->flash
Daniel Westermann-Clark
daniel at acceleration.net
Tue Mar 7 07:26:39 CET 2006
When using only $c->flash (i.e. no $c->session access), I see warnings
like the following:
[Tue Mar 7 00:37:13 2006] [catalyst] [warn] Deleting session
f856df98f25fa2dffa63ddb76615588f6cdb7bae due to address mismatch ( !=
192.168.1.10)
Note the address C::P::Session is comparing against is blank.
Attached is a patch to initialize the session when creating a new
flash data structure, which ensures the address is correctly saved in
the session store.
I also did a little bit of releng: bumping the version, fixing a
couple of typos in Build.PL, and making 99_prereq.t optional. There
are also a couple of fixes to Tutorial.pod, which should hopefully
make it show up on search.cpan.org. :)
--
Daniel Westermann-Clark
-------------- next part --------------
Auto-merging (0, 6787) /local/Catalyst-Plugin-Session to /mirror/Catalyst/trunk/Catalyst-Plugin-Session (base /mirror/Catalyst/trunk/Catalyst-Plugin-Session:4956).
Patching locally against mirror source http://dev.catalyst.perl.org/repos/Catalyst.
U t/99_prereq.t
U lib/Catalyst/Plugin/Session/Tutorial.pod
U lib/Catalyst/Plugin/Session.pm
U Changes
U Build.PL
==== Patch <-> level 1
Source: 20164c6d-cd09-0410-925d-b4c4e616b846:/local/Catalyst-Plugin-Session:6787
Target: 4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Plugin-Session:3250
(http://dev.catalyst.perl.org/repos/Catalyst)
Log:
Make test optional, not everyone has Test::Prereq
Hopefully this will make it show up on search.cpan.org
Typos
Initialize the session when creating a new flash structure to avoid address mismatch warnings
=== t/99_prereq.t
==================================================================
--- t/99_prereq.t (revision 3250)
+++ t/99_prereq.t (patch - level 1)
@@ -2,7 +2,9 @@
use strict;
use warnings;
+use Test::More;
-use Test::Prereq::Build;
+eval "use Test::Prereq::Build";
+plan skip_all => "Test::Prereq::Build is required for this test" if $@;
+
prereq_ok();
-
=== lib/Catalyst/Plugin/Session/Tutorial.pod
==================================================================
--- lib/Catalyst/Plugin/Session/Tutorial.pod (revision 3250)
+++ lib/Catalyst/Plugin/Session/Tutorial.pod (patch - level 1)
@@ -1,5 +1,3 @@
-=pod
-
=head1 NAME
Catalyst::Plugin::Session::Tutorial - Understanding and using sessions.
@@ -266,11 +264,11 @@
=over 4
-=item 1
+=item 1.
The user can change the data.
-=item 2
+=item 2.
Cookies have a 4 kilobyte size limit.
@@ -284,8 +282,6 @@
This can be implemented by encrypting and signing the cookie data, but this is
a big headache.
-=back
-
=head2 Session Hijacking
What happens when client B says "I'm client A"? Well, basically, the server
@@ -322,4 +318,3 @@
Yuval Kogman E<lt>nothingmuch at woobling.orgE<gt>
=cut
-
=== lib/Catalyst/Plugin/Session.pm
==================================================================
--- lib/Catalyst/Plugin/Session.pm (revision 3250)
+++ lib/Catalyst/Plugin/Session.pm (patch - level 1)
@@ -12,7 +12,7 @@
use overload ();
use Object::Signature ();
-our $VERSION = "0.05";
+our $VERSION = "0.06";
my @session_data_accessors; # used in delete_session
BEGIN {
@@ -276,7 +276,6 @@
$c->_session || $c->_load_session || do {
$c->create_session_id;
-
$c->initialize_session_data;
};
}
@@ -285,6 +284,7 @@
my $c = shift;
$c->_flash || $c->_load_flash || do {
$c->create_session_id;
+ $c->initialize_session_data;
$c->_flash( {} );
}
}
=== Changes
==================================================================
--- Changes (revision 3250)
+++ Changes (patch - level 1)
@@ -2,8 +2,9 @@
0.06
- Set sessionid only if unset, allowing State plugins to stack (gphat)
+ - Initialize the session if necessary when using $c->flash (dwc)
-0.05
+0.05 2006-01-01 10:44:39
- Un-workaround the Cache::FastMmap (actually Storable) limitation -
it's not C::P::Session's business.
- add $c->session_expires
=== Build.PL
==================================================================
--- Build.PL (revision 3250)
+++ Build.PL (patch - level 1)
@@ -17,12 +17,10 @@
'Test::More' => 0,
'Test::Exception' => 0,
},
- reccomends => {
-
+ recommends => {
# for live_app.t
- 'Test::WWW::Mechanize::Catalyst' => 0,
- 'Catalyst::Plugin::Session::Cookie' => 0,
-
+ 'Test::WWW::Mechanize::Catalyst' => 0,
+ 'Catalyst::Plugin::Session::State::Cookie' => 0,
},
create_readme => 1,
sign => 1,
==== BEGIN SVK PATCH BLOCK ====
Version: svk 1.07 (linux)
eJyNVt2O20QUjqjERXoBUoXoDdKwddUWNcn8+m9pFFFRgaBopS5UiItoPDPeWOvYwZ7sssUXTYEK
+gJIfQTuEDxDL7juK/AeHI93t7uQZoksZew5853znfnOmblX7W5PSDMe48YjuHnw1WdxvCOtml0n
vPH8xujMlpUnmtwcmNxjTV7uebwp5NzAbF0uK9UOrKz2jG0Hmdo3djwmABd2cB87iBNYh5pIWxa1
Fzn4qa2M8WhDyITQZsLaZ+qRqKkNzDngaWUOsjorC3DtB2EAFh5pCACUC1NMq7K0MMNEEExouxY3
Ki9rM23hJ6KBB8ypB5Scvc4qoyCmI/hqHdDxYmfH19gB7yz5lyVEjE8iSLPceEFzdyaLPVP/15Cc
Mwybj5ZZroc7n5+1dKzFceRnQyRAqguNnYMhrLGjKJouKlOZb4fWcbwIjHZgblYuFvnR1JrvrDa5
lc4Bow0XGqdh6ieME4WZr3UgSRoIwZgOjYlgbyhs7Re93oMVvbSij1f02vujZV2NkqwYLUyV9/vL
2qDaVpmy2258KKsiK/bq7m3X1DaO75eV2e73zYHM0darzzuOThy7HG1t9xe5LFC9ny2mMs/RnTHa
WmOHshrB2xKYapSWFbIz+GLBcAtlKfIm4KjL07Tcv3lruz/hZ4XS5bOjnwqslE9TLBTngWIhk4lI
lCZUE6xFdLobYp2gaKuU0V1pZX5UWyeni7aEnyL66xCjc4ijnXy5lxXO/UXAoi0mBxysAabBOuDR
A1O7SmujOVsW0TntMbxp8XAxP7v+tQH6p8zDc+h8I/podwnrM5kPF6V25C7yE2wUfehEL0NFQioN
84nRRKRUKUmUCE1CjOLQ5MJO8y8/fInf+qD3Inzzt94Pd1+kvWeX/8LDfn93ZhCIuEIK5KpcIwAR
GqSBBEzfyayZIzpcqzsXgUhDIoTxpYh8JaSmkRGYBSJJUip4tJlD5DgEmins+wk3fqoYkYmWvgoj
TAyDStaeOOaw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