I have a sqlite3 database with the sessions table and schema set up correctly. Sessions are created fine and put in the table, the cookie is set with the correct hash and the hash is found again but when using @state the values aren?t updated in the table. I know that Session::service is called and the contents of the record are put into session like so: #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {}> I do @state.user = 5, then it then gets as far as making session look like this: #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {"TLCMS"=>{"user"=>5}}> But then session.save doesn?t write to the table, and doesn?t throw an error (session.save! doesn?t either). Can anyone see what is going wrong? FWIW I?m using FastCGI -- Fred O. Phillips http://fophillips.org BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://rubyforge.org/pipermail/camping-list/attachments/20080728/569e968f/attachment.bin>
Is this with Camping 1.5 or Camping 2.0? -- Eric On Mon, Jul 28, 2008 at 6:05 PM, Fred Phillips <fophillips at fophillips.org> wrote:> I have a sqlite3 database with the sessions table and schema set up > correctly. Sessions are created fine and put in the table, the cookie > is set with the correct hash and the hash is found again but when > using @state the values aren''t updated in the table. > > I know that Session::service is called and the contents of the record > are put into session like so: > #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {}> > > I do @state.user = 5, then it then gets as far as making session look > like this: > #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {"TLCMS"=>{"user"=>5}}> > > But then session.save doesn''t write to the table, and doesn''t throw an > error (session.save! doesn''t either). Can anyone see what is going > wrong? > > FWIW I''m using FastCGI > > -- > Fred O. Phillips > http://fophillips.org > BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
This happened to me... I saw an email on this list earlier about AR 2.1.0 having problems, and reverting back to 2.0.2 got session support working again. On the command line: $ gem install --version ''=2.0.2'' activerecord In Camping: gem ''activerecord'', ''=2.0.2'' Alpha On Mon, Jul 28, 2008 at 9:15 PM, Eric Mill <kprojection at gmail.com> wrote:> Is this with Camping 1.5 or Camping 2.0? > > -- Eric > > On Mon, Jul 28, 2008 at 6:05 PM, Fred Phillips > <fophillips at fophillips.org> wrote: >> I have a sqlite3 database with the sessions table and schema set up >> correctly. Sessions are created fine and put in the table, the cookie >> is set with the correct hash and the hash is found again but when >> using @state the values aren''t updated in the table. >> >> I know that Session::service is called and the contents of the record >> are put into session like so: >> #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {}> >> >> I do @state.user = 5, then it then gets as far as making session look >> like this: >> #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {"TLCMS"=>{"user"=>5}}> >> >> But then session.save doesn''t write to the table, and doesn''t throw an >> error (session.save! doesn''t either). Can anyone see what is going >> wrong? >> >> FWIW I''m using FastCGI >> >> -- >> Fred O. Phillips >> http://fophillips.org >> BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 >> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
Is it that AR 2.1 only has problems in conjunction with Camping? Or is table-based session support totally broken in Rails 2.1 right now? -- Eric On Tue, Jul 29, 2008 at 1:10 AM, Alpha Chen <alpha.chen at gmail.com> wrote:> This happened to me... I saw an email on this list earlier about AR > 2.1.0 having problems, and reverting back to 2.0.2 got session support > working again. > > On the command line: > $ gem install --version ''=2.0.2'' activerecord > > In Camping: > gem ''activerecord'', ''=2.0.2'' > > Alpha > > On Mon, Jul 28, 2008 at 9:15 PM, Eric Mill <kprojection at gmail.com> wrote: >> Is this with Camping 1.5 or Camping 2.0? >> >> -- Eric >> >> On Mon, Jul 28, 2008 at 6:05 PM, Fred Phillips >> <fophillips at fophillips.org> wrote: >>> I have a sqlite3 database with the sessions table and schema set up >>> correctly. Sessions are created fine and put in the table, the cookie >>> is set with the correct hash and the hash is found again but when >>> using @state the values aren''t updated in the table. >>> >>> I know that Session::service is called and the contents of the record >>> are put into session like so: >>> #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {}> >>> >>> I do @state.user = 5, then it then gets as far as making session look >>> like this: >>> #<Camping::Models::Session id: 1, hashid: "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", ivars: {"TLCMS"=>{"user"=>5}}> >>> >>> But then session.save doesn''t write to the table, and doesn''t throw an >>> error (session.save! doesn''t either). Can anyone see what is going >>> wrong? >>> >>> FWIW I''m using FastCGI >>> >>> -- >>> Fred O. Phillips >>> http://fophillips.org >>> BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 >>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >
On Mon Jul 28 22:10:44 2008, Alpha Chen wrote:> This happened to me... I saw an email on this list earlier about AR > 2.1.0 having problems, and reverting back to 2.0.2 got session support > working again. > > On the command line: > $ gem install --version ''=2.0.2'' activerecord > > In Camping: > gem ''activerecord'', ''=2.0.2'' > > Alpha >Thanks, worked perfectly. -- Fred O. Phillips http://fophillips.org BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://rubyforge.org/pipermail/camping-list/attachments/20080729/ffc4fd38/attachment.bin>
For some reason, AR 1.2 can''t save serialized data. At least in the tests I have done with Camping''s Session model. For now we have to stick with 2.0.2, but I know the problem has been reported. 2008/7/29, Eric Mill <kprojection at gmail.com>:> Is it that AR 2.1 only has problems in conjunction with Camping? Or > is table-based session support totally broken in Rails 2.1 right now? > > -- Eric > > On Tue, Jul 29, 2008 at 1:10 AM, Alpha Chen <alpha.chen at gmail.com> wrote: >> This happened to me... I saw an email on this list earlier about AR >> 2.1.0 having problems, and reverting back to 2.0.2 got session support >> working again. >> >> On the command line: >> $ gem install --version ''=2.0.2'' activerecord >> >> In Camping: >> gem ''activerecord'', ''=2.0.2'' >> >> Alpha >> >> On Mon, Jul 28, 2008 at 9:15 PM, Eric Mill <kprojection at gmail.com> wrote: >>> Is this with Camping 1.5 or Camping 2.0? >>> >>> -- Eric >>> >>> On Mon, Jul 28, 2008 at 6:05 PM, Fred Phillips >>> <fophillips at fophillips.org> wrote: >>>> I have a sqlite3 database with the sessions table and schema set up >>>> correctly. Sessions are created fine and put in the table, the cookie >>>> is set with the correct hash and the hash is found again but when >>>> using @state the values aren''t updated in the table. >>>> >>>> I know that Session::service is called and the contents of the record >>>> are put into session like so: >>>> #<Camping::Models::Session id: 1, hashid: >>>> "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", >>>> ivars: {}> >>>> >>>> I do @state.user = 5, then it then gets as far as making session look >>>> like this: >>>> #<Camping::Models::Session id: 1, hashid: >>>> "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 17:11:43", >>>> ivars: {"TLCMS"=>{"user"=>5}}> >>>> >>>> But then session.save doesn''t write to the table, and doesn''t throw an >>>> error (session.save! doesn''t either). Can anyone see what is going >>>> wrong? >>>> >>>> FWIW I''m using FastCGI >>>> >>>> -- >>>> Fred O. Phillips >>>> http://fophillips.org >>>> BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 >>>> >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-- Magnus Holm
Also worth noting that camping includes it''s own session support. We''re not using bits from rails for sessions except for ActiveRecord itself, and then only if you''re using active record sessions. You might like to try the cookie sessions included in current Camping 2.0 builds (Magnus has more info on where you can grab those gems) which doesn''t depend on ActiveRecord, if your session data can fit in under a couple of KB''s. There''s also an older though fully functional implementation of cookie sessions on the wiki for 1.5 by yours truly. :) essentially it works by storing the @state hash in a cookie, and digitally signing the data with an SHA hash of some sort, so while the user can see what''s in their session if they''re determined enough, they cannot tamper with it without knowing rather secret details about your server environment. You can also provide a custom key in your code for it to use for security bonus points. Without the key, so long as SHA isn''t ever broken, they won''t be able to tamper with the data without the server realizing and invalidating the session, starting them afresh. :) I really hope the ActiveRecord crew sort this out before we get too close to releasing 2.0 officially! :)
I''ve pointed to the fact that its not a problem of activerecord but the stubbornness of the camping session module (insisting on natural primary key) that keeps it from working -- Julian "Julik" Tarkhanov On 29-jul-2008, at 17:13, "Bluebie, Jenna" <blueberry at creativepony.com> wrote:> Also worth noting that camping includes it''s own session support. > We''re not using bits from rails for sessions except for ActiveRecord > itself, and then only if you''re using active record sessions. You > might like to try the cookie sessions included in current Camping > 2.0 builds (Magnus has more info on where you can grab those gems) > which doesn''t depend on ActiveRecord, if your session data can fit > in under a couple of KB''s. There''s also an older though fully > functional implementation of cookie sessions on the wiki for 1.5 by > yours truly. :) > > essentially it works by storing the @state hash in a cookie, and > digitally signing the data with an SHA hash of some sort, so while > the user can see what''s in their session if they''re determined > enough, they cannot tamper with it without knowing rather secret > details about your server environment. You can also provide a custom > key in your code for it to use for security bonus points. Without > the key, so long as SHA isn''t ever broken, they won''t be able to > tamper with the data without the server realizing and invalidating > the session, starting them afresh. :) > > I really hope the ActiveRecord crew sort this out before we get too > close to releasing 2.0 officially! :) > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list
ActiveRecord::Base.partial_updates = false and you should be good to go -- Julian "Julik" Tarkhanov On 29-jul-2008, at 16:11, "Magnus Holm" <judofyr at gmail.com> wrote:> For some reason, AR 1.2 can''t save serialized data. At least in the > tests I have done with Camping''s Session model. > > For now we have to stick with 2.0.2, but I know the problem has been > reported. > > 2008/7/29, Eric Mill <kprojection at gmail.com>: >> Is it that AR 2.1 only has problems in conjunction with Camping? Or >> is table-based session support totally broken in Rails 2.1 right now? >> >> -- Eric >> >> On Tue, Jul 29, 2008 at 1:10 AM, Alpha Chen <alpha.chen at gmail.com> >> wrote: >>> This happened to me... I saw an email on this list earlier about AR >>> 2.1.0 having problems, and reverting back to 2.0.2 got session >>> support >>> working again. >>> >>> On the command line: >>> $ gem install --version ''=2.0.2'' activerecord >>> >>> In Camping: >>> gem ''activerecord'', ''=2.0.2'' >>> >>> Alpha >>> >>> On Mon, Jul 28, 2008 at 9:15 PM, Eric Mill <kprojection at gmail.com> >>> wrote: >>>> Is this with Camping 1.5 or Camping 2.0? >>>> >>>> -- Eric >>>> >>>> On Mon, Jul 28, 2008 at 6:05 PM, Fred Phillips >>>> <fophillips at fophillips.org> wrote: >>>>> I have a sqlite3 database with the sessions table and schema set >>>>> up >>>>> correctly. Sessions are created fine and put in the table, the >>>>> cookie >>>>> is set with the correct hash and the hash is found again but when >>>>> using @state the values aren''t updated in the table. >>>>> >>>>> I know that Session::service is called and the contents of the >>>>> record >>>>> are put into session like so: >>>>> #<Camping::Models::Session id: 1, hashid: >>>>> "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 >>>>> 17:11:43", >>>>> ivars: {}> >>>>> >>>>> I do @state.user = 5, then it then gets as far as making session >>>>> look >>>>> like this: >>>>> #<Camping::Models::Session id: 1, hashid: >>>>> "iSCMSIzV7ITsRTr0UMA8Gko3LEnY3bw4", created_at: "2008-07-24 >>>>> 17:11:43", >>>>> ivars: {"TLCMS"=>{"user"=>5}}> >>>>> >>>>> But then session.save doesn''t write to the table, and doesn''t >>>>> throw an >>>>> error (session.save! doesn''t either). Can anyone see what is going >>>>> wrong? >>>>> >>>>> FWIW I''m using FastCGI >>>>> >>>>> -- >>>>> Fred O. Phillips >>>>> http://fophillips.org >>>>> BBC7 7572 755F 83E0 3209 504A E4F7 874F 1545 9D41 >>>>> >>>>> _______________________________________________ >>>>> Camping-list mailing list >>>>> Camping-list at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/camping-list >>>>> >>>> _______________________________________________ >>>> Camping-list mailing list >>>> Camping-list at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/camping-list >>>> >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list at rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > -- > Magnus Holm > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list