Ruby on Rails
Monday, December 31, 2012
Instead of adding a session parameter to every url_for call, alias method chain it. any url helper calls url_for anyway, so you're good.
Make sure the encryption is good with the session id, and don't use weak ones like base64, they make session spoofing so much easier.
--
Dheeraj Kumar
On Monday 31 December 2012 at 3:49 PM, Rajarshi wrote:
url_for(:controller => "name of the controller", :action => "name pf the aciont", :session => params[:value])
or
users_url(:session => params[:value])
it will create a dybnamic url like /users?session="sdsadsadasdas213213213"
and in params[:value] you have to encrypt the session id what you get from database
or encode64(params[:value])
now while it i s hitting it will send the request in that reuqest you have to parse it by decode64() and match the session id
On Mon, Dec 31, 2012 at 2:10 PM, Rajesh KT <lists@ruby-forum.com> wrote:Dheeraj Kumar wrote in post #1090693:
> I just said what you need. chain the url_for method to add session id toThanks Dheeraj. Truly appreciate if you can point me to some code
> the parameters, and read the session id in your application controller,
> look it up in your session store, active record or memcache, then load
> whatever information you want from the database.
>
> --
> Dheeraj Kumar
examples for this.
Thanks
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment