hi all, in my application, i have login form. while login into the application iam maintaning the details in session. i want to remove the stale sessions and while removing the stale sessions i want to perform some operattions on database . how to do this. Regards, Rajkumar -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> > in my application, i have login form. while login into the application > iam maintaning the details in session. i want to remove the stale > sessions and while removing the stale sessions i want to perform some > operattions on database . how to do this. >How are the sessions stored? The default now is Cookie store, so you can''t easily delete all sessions. If you''re using file store, you can just remove all files in the folder, if your using a DB store you can truncate the table. The other way is to have a version field checked/set in a filter in your application and empty any incoming session requests if they don''t have the right version. It won''t delete them all immediately, but at the time they''re being used. Cheers, Andy -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 27 Apr 2010, at 17:44, Andy Jeffries wrote:> in my application, i have login form. while login into the application > iam maintaning the details in session. i want to remove the stale > sessions and while removing the stale sessions i want to perform some > operattions on database . how to do this. > > How are the sessions stored? The default now is Cookie store, so > you can''t easily delete all sessions. If you''re using file store, > you can just remove all files in the folder, if your using a DB > store you can truncate the table. > > The other way is to have a version field checked/set in a filter in > your application and empty any incoming session requests if they > don''t have the right version. It won''t delete them all immediately, > but at the time they''re being used.Well, if you''re using the cookiestore for sessions, you don''t have to worry about stale sessions anyway. The file store should be avoided imo, the IO is simply too expensive. Database session storage is an option, although I see little to no reason to use it when you have something that just takes session storage away from the server. Your database optimizations and operations can be run as a cron tab, just call a rake task that does what it needs to do and be done with it. Best regards Peter De Berdt -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Apr 27, 2010 at 8:56 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> Well, if you''re using the cookiestore for sessions, you don''t have to worry > about stale sessions anyway.? How so? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 27 Apr 2010, at 18:13, Hassan Schroeder wrote:>> Well, if you''re using the cookiestore for sessions, you don''t have >> to worry >> about stale sessions anyway. > > ? How so?Because the session data is kept in a cookie on the client side, not on the server in any way. The session is removed on the user''s computer when he quits his browser. As long as you''re not storing more than 4KB of (sensitive) data in the session (which you should never do in the first place), it''s the least expensive session storage with the least redundant data hanging around. Best regards Peter De Berdt -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Apr 27, 2010 at 9:38 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> Well, if you''re using the cookiestore for sessions, you don''t have to worry > about stale sessions anyway. > > ? How so? > > Because the session data is kept in a cookie on the client side, not on the > server in any way. The session is removed on the user''s computer when he > quits his browser.That''s irrelevant if the app in question depends on inactive sessions being expired. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 27 Apr 2010, at 18:50, Hassan Schroeder wrote:>> Well, if you''re using the cookiestore for sessions, you don''t have >> to worry >> about stale sessions anyway. >> >> ? How so? >> >> Because the session data is kept in a cookie on the client side, >> not on the >> server in any way. The session is removed on the user''s computer >> when he >> quits his browser. > > That''s irrelevant if the app in question depends on inactive sessions > being expired.http://dev.rubyonrails.org/ticket/10751 Best regards Peter De Berdt -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Tue, Apr 27, 2010 at 9:56 AM, Peter De Berdt <peter.de.berdt-LPO8gxj9N8aZIoH1IeqzKA@public.gmane.org> wrote:> > That''s irrelevant if the app in question depends on inactive sessions > being expired. > > http://dev.rubyonrails.org/ticket/10751Interesting but also irrelevant; recognizing a request for an expired session is not the same as explicitly expiring a session and doing any necessary cleanup. But thanks for the reference. -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
hi all, in my application i have to maintain the user information in session and updates the table flag when the user logins and while loggingout i change the flag to zero. i want to delete the stale sessions and while doing this i want to perform operation on tables how to do this. Please let me know Regards, Rajkumar.surabhi -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.