Eduardo Yáñez Parareda
2006-Aug-22 16:16 UTC
[Rails] Re: Removing session file from filesystem upon logout
> You can do that if you''ve got sessions stored in the database. When > the user logs out, simply delete the record corresponding to that > user''s session.How could I do that?. I store sessions on database. When the user logs out, I do reset_session but I''ve tried delete the session doing session.destroy but it raises an exception because CGI::Session doesn''t have that method. Do I need to delete the session with an explicit SQL sentence? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Wes Gamble
2006-Aug-22 16:34 UTC
[Rails] Re: Removing session file from filesystem upon logout
Does anyone know how to get the PStore filename for a given session? -- 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 -~----------~----~----~----~------~----~------~--~---
Wes Gamble
2006-Aug-22 16:44 UTC
[Rails] Re: Removing session file from filesystem upon logout
OK, now that I look more closely, I see that reset_session actually takes care of the persisted session in the PStore filesystem. It deletes the old file and then a new one is created to handle the new session that it creates. Just in case anyone is interested though, this should be the filename that a given PStore session is stored in: ruby_sess." + Digest::MD5.hexdigest(session.session_id)[0,16] assuming a default prefix on the filename. I just looked in pstore.rb under the CGI library. Wes -- 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 -~----------~----~----~----~------~----~------~--~---
Yan Pritzker
2006-Aug-22 17:23 UTC
[Rails] Re: Removing session file from filesystem upon logout
Try "puts session.inspect", it will show you all the fun attributes of the session. Usually a good first step in answering any question is to invoke the ''inspect'' method on the object in question as it can tell you a lot about what''s available to you Yan http://skwp.wordpress.com http://planyp.us On Tue, 22 Aug 2006 11:34:06 -0500, Wes Gamble <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Does anyone know how to get the PStore filename for a given session? > >-- Using Opera''s revolutionary e-mail client: http://www.opera.com/m2/ --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---