"string not matched" with AR session store


#1

hi all,

i have had this problem for a while and so have been unable to use
activerecord to store my sessions.

shortly after login it get a ‘string not matched’ exception and it looks
like it is occuring during some ‘flash’ methods. i was under the
impression that this used to occur when your session was too large so i
have reduced my session values to just id’s (rather than storing entire
objects) to reduce their size. it still happens.

i would really like to get my sessions in the database. has anyone else
had trouble with this.

i have the following specs:

mysql 4.1.15
rails 0.14.2.2752
activerecord 1.12.2.2752
using webrick

thanks heaps,

-felix


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Nov 14, 2005, at 5:16 PM, Felix McCoey wrote:

objects) to reduce their size. it still happens.
using webrick

thanks heaps,

Hi Felix,

Are you on Windows, Linux, Mac, ?

Are you using the mysql adapter that comes with Rails, or did you
upgrade to the C bindings (gem install mysql)?

Does the problem occur outside of webrick?

Thanks!
jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)

iD8DBQFDedSYAQHALep9HFYRAs5YAJsHb30+5Jvn5HSuXuSfROrpOrt0wgCeKTY3
LG0373dAyh68WcdQSQbPYRs=
=WJvU
-----END PGP SIGNATURE-----


#3

This problem sounds like an issue we’ve seen where using
ActiveRecord-backed session stores under development mode suddenly
reverts back to PStore sessions after a few accesses. FYI, we’ve seen
this on Rails 0.13.1, using the SQLServer adapter in ODBC mode, with
Webrick.

Are you seeing ‘pstore’ in your error messages at all? If so,
basically it seems like the session-store configuration gets lost in
all the reloading jazz (it works fine in production, we’ve seen).

I wish I could give you a solution…

  • james

#4

James A. wrote:

This problem sounds like an issue we’ve seen where using
ActiveRecord-backed session stores under development mode suddenly
reverts back to PStore sessions after a few accesses. FYI, we’ve seen
this on Rails 0.13.1, using the SQLServer adapter in ODBC mode, with
Webrick.

Are you seeing ‘pstore’ in your error messages at all? If so,
basically it seems like the session-store configuration gets lost in
all the reloading jazz (it works fine in production, we’ve seen).

yes, i get the following in the trace:

#{RAILS_ROOT}usr/lib/ruby/1.8/cgi/session/pstore.rb:25:in []=' #{RAILS_ROOT}usr/lib/ruby/1.8/cgi/session/pstore.rb:25:in[]=’
#{RAILS_ROOT}usr/lib/ruby/gems/1.8/gems/actionpack-1.10.2.2752/lib/action_controller/flash.rb:141:in
flash' #{RAILS_ROOT}usr/lib/ruby/gems/1.8/gems/actionpack-1.10.2.2752/lib/action_controller/flash.rb:154:infire_flash’

now if it works in a production environment and not development then
that is great, just make testing all my session accessing function a
little trickier.

does anyone actually know what is causing it?

I wish I could give you a solution…

pity, but thanks

-felix


#5

Jeremy K. wrote:

Are you on Windows, Linux, Mac, ?

Are you using the mysql adapter that comes with Rails, or did you
upgrade to the C bindings (gem install mysql)?

i am currently on linux using the mysql adapter that comes with rails. i
will try the gem one and report

Does the problem occur outside of webrick?

yes, it has happened with lighttpd and apache2 and just using irb so i
don’t think that is an issue.

-felix


#6

Oops! I’ve been bitten by this very often in development, and also in
production.
I’ve seen this on Windows+Webrick, Windows+Apache2+FCGI,
Debian+Apache2+FCGI
(all Mysql)

Everything went OK on my Typo-based commerce app, untill I added a cart
object to be stored in the session. Since then, this problem periodicaly
shows up.

I’m now desperatly looking for a fix to this issue, and can provide more
environment data if needed.

ERic