Session question?

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

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,

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 W. 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,

koloa wrote:

since each user has a different :cat value and thier own hash, the
program executes correctly?

Absolutely correct.