Get request by session id?

61 views
Skip to first unread message

Hans Hartmann

unread,
Feb 11, 2011, 5:55:18 AM2/11/11
to rubyonra...@googlegroups.com
Hello,

i've stored my sessions in a session table and can acces them via:

Session.all (id, session_id, data, c_at, u_at)

also i can get my current session_id via:

request.session_options[:id]

Is there a possibility to find all request containing to every single
session - to get an overview beyond the env of every session.

Something like:
Request.find_by_session_id(session_id).env

Thanks for your answers 'till now.

Hans

--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Feb 11, 2011, 5:57:35 AM2/11/11
to Ruby on Rails: Talk


On Feb 11, 10:55 am, Hans Hartmann <li...@ruby-forum.com> wrote:
> Hello,
>
> i've stored my sessions in a session table and can acces them via:
>
> Session.all (id, session_id, data, c_at, u_at)
>
> also i can get my current session_id via:
>
> request.session_options[:id]
>
> Is there a possibility to find all request containing to every single
> session - to get an overview beyond the env of every session.
>
> Something like:
> Request.find_by_session_id(session_id).env
>

I'm not sure what you're after - requests aren't persisted anywhere
(unless you're doing something special to do that)

Fred

Hans Hartmann

unread,
Feb 11, 2011, 6:12:18 AM2/11/11
to rubyonra...@googlegroups.com
> I'm not sure what you're after - requests aren't persisted anywhere
> (unless you're doing something special to do that)

I want to find a possibility to get the PATH_INFO of each session user.

My first opinion to do that was to list the env of all sessions.

The reason I want to do that is to forbid, that two session users can
access an update form on the same time.

I have to check on which site all session users currently are.

Frederick Cheung

unread,
Feb 11, 2011, 8:31:26 AM2/11/11
to Ruby on Rails: Talk


On Feb 11, 11:12 am, Hans Hartmann <li...@ruby-forum.com> wrote:
> > I'm not sure what you're after - requests aren't persisted anywhere
> > (unless you're doing something special to do that)
>
> I want to find a possibility to get the PATH_INFO of each session user.
>
> My first opinion to do that was to list the env of all sessions.
>
> The reason I want to do that is to forbid, that two session users can
> access an update form on the same time.
>
I don't think there's anyway of doing this without you storing details
of all requests (is there even a thing as 'the' PATH_INFO? A user
could have multiple windows)
I think you're approaching this wrong way. I would tackle this by
having a flag saying that a record is being used/edited by someone
else.

Fred
Reply all
Reply to author
Forward
0 new messages