Need User All login and logout times

45 views
Skip to first unread message

Saravanan P

unread,
Jan 2, 2013, 1:46:56 AM1/2/13
to rubyonra...@googlegroups.com
Hello everyone,

I need user All login and logout time. not only last login and logout time.
I am using rails 3.2.8 + devise gem for User.

Is there any way to get all time? 

Saravanan.

Dheeraj Kumar

unread,
Jan 2, 2013, 2:07:48 AM1/2/13
to rubyonra...@googlegroups.com

-- 
Dheeraj Kumar

--
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 rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/Fc-UcJCoDm4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Saravanan P

unread,
Jan 2, 2013, 2:15:27 AM1/2/13
to rubyonra...@googlegroups.com
Hi Dheeraj

Thanks for reply.
In Trackable, i can only see total sign in count, last sign in time and sign out time...
But I need, users all sign in and sign out time stamp.
Is there any way?

I can implement this by adding records in separate table by devise "after sign in" and "after sign out" method. But i think its not good idea to get that.


--
Regards by
Saravanan.P

Dheeraj Kumar

unread,
Jan 2, 2013, 2:20:58 AM1/2/13
to rubyonra...@googlegroups.com
Why don't you think its a good way?

-- 
Dheeraj Kumar

Saravanan P

unread,
Jan 2, 2013, 2:44:34 AM1/2/13
to rubyonra...@googlegroups.com
May be if your open private window and signin. 
Then without signout, the user close browser my code (i.e "after sign out" method) will not run and i cant get sign out time... thats why i said...

Jim Ruther Nill

unread,
Jan 2, 2013, 2:46:03 AM1/2/13
to rubyonra...@googlegroups.com
On Wed, Jan 2, 2013 at 3:20 PM, Dheeraj Kumar <a.dheer...@gmail.com> wrote:
Why don't you think its a good way?

-- 
Dheeraj Kumar

On Wednesday 2 January 2013 at 12:45 PM, Saravanan P wrote:

Hi Dheeraj

Thanks for reply.
In Trackable, i can only see total sign in count, last sign in time and sign out time...
But I need, users all sign in and sign out time stamp.
Is there any way?
For past logins and logouts, there's no other way to get it other than parsing the log files.
But I think that's no easy task plus you usually don't have info on who logged in and out
in the logs so that may also be impossible.
 
I can implement this by adding records in separate table by devise "after sign in" and "after sign out" method. But i think its not good idea to get that.
this is probably the best way to get what you want

Good luck!



--
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

Jim Ruther Nill

unread,
Jan 2, 2013, 2:48:55 AM1/2/13
to rubyonra...@googlegroups.com
On Wed, Jan 2, 2013 at 3:44 PM, Saravanan P <sarav...@shriramits.com> wrote:
May be if your open private window and signin. 
Then without signout, the user close browser my code (i.e "after sign out" method) will not run and i cant get sign out time... thats why i said...

you can get around this by using javascript and ajax.  Look at before https://developer.mozilla.org/en-US/docs/DOM/window.onbeforeunload



--

Saravanan P

unread,
Jan 2, 2013, 3:14:41 AM1/2/13
to rubyonra...@googlegroups.com
Ok Thanks for the reply Dheeraj Kumar and Jim Ruther Nill.
Reply all
Reply to author
Forward
0 new messages