hi, i have a rails application that stores what the user selects in my view... for example.... in myController if(params[:category] != nil) session[:cat] = params[:category] in my application.rb if (session[:cat] == ''food'') getmypaginateobj .... now this is for one user, what happens when other users go to my site? they get their own session hash right? since my application is all public, i dont need to store id right? thx -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
koloa wrote:> now this is for one user, what happens when other users go to my site? > they get their own session hash right? since my application is all > public, i dont need to store id right?session is always specific to whoever is browsing your site at the time. When the user first comes to your site, they get their own session id automatically. Rails uses that session id to fetch the session data only for that user. So noone else will ever be able to peek inside a session that doesnt belong to them, -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi Alex, thanks for the response.. since when i excute a function based on a hash value, that value is specific only to that user correct? like if 2 different users are using my application and i have a statement like this. session[:cat] = params[:cat] #user 1 has session[:cat] = 1 #user 2 has session[:cat] = 2 and in my application.rb i have if session[:cat] == 1 some code.. end if session[:cat] == 2 some code.. end since each user has a different :cat value and thier own hash, the program executes correctly? Alex Wayne wrote:> koloa wrote: >> now this is for one user, what happens when other users go to my site? >> they get their own session hash right? since my application is all >> public, i dont need to store id right? > > session is always specific to whoever is browsing your site at the time. > When the user first comes to your site, they get their own session id > automatically. Rails uses that session id to fetch the session data > only for that user. > > So noone else will ever be able to peek inside a session that doesnt > belong to them,-- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
koloa wrote:> since each user has a different :cat value and thier own hash, the > program executes correctly?Absolutely correct. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---