From: "Pål Bergström" Date: 2010-09-04T16:59:11+09:00 Subject: Re: Read cookie Brian Candler wrote: > The value displayed (which is the value in the cookie) is the timestamp > of the previous request. But that's in the controller. Or do I miss something? > > So it took a very long time to get here, given that you didn't say in > the first place you were writing a Rails app (probably the question > would have been better directed to a Rails forum then); then in another > posting you said "Never mind > Rails. I don't need the cookie there"; in another you mentioned > net/http. I thought it would be better here as I thought it was more relevant for Ruby than Rails. I've asked in Rails before but didn't get a solution. And I'm not a pure programmer (obviously), more a designer trying to build web apps. I'm still learning. Otherwise I wouldn't ask and I would know exactly the difference between cgi, net/http, and so on. One more time: 1) I have a Rails app. 2) I have/had certain data aes encrypted in certain columns in mysql with a unique key for each user. That key is saved in a cookie. If they use an iPhone or another browser they need to ad the key to each browser. It's just another layer of security on top of Rails. So if someone get hold of that key it's useless unless you login or break the security of mysql. 3) l use "before_save" and "fast-aes" in the model. So everything happes in the model and in a script for encrypting located in /lib, just because I can't get the cookie into the model with rails cookies[:my_cookie]. Or can I? Maybe I'm overlooking something. Can get the value of a cookie from the controller into the model in a simple uniform way? 4) I used cgi to get the cookie value before. Now I can't do that after rails 2.3.x. I wonder if I can do it in another way? -- Posted via http://www.ruby-forum.com/.