Doubts in Login - Session

Hi Friendz,

I am using Login generator in my application.

I need clarification:
for ex:

If a user login to the app. from one system. He shouldnot be allowed
to login from another System at the same time. i.e Each User can login
to the app. once at a time. can u Guys plz tell me , how to tackle this
task.

Advance Thx,
Regards,
Karthick.

Jason N. wrote:

You could create a logged-in users table, log their user id an IP. Also
their session ID?
When users log in, check to make sure their user ID isn’t in the table,
then write their connection to the table.
When they log out, delete the entry.
But what if they just disconnect and don’t log out? You’ll need to do
some sort of housekeeping every so often on sessions/logged connections.
I’ve not tackled this problem yet, but you’d probably have to do it from
a cron job. I have several rails tasks that run only from cron and it
works very well.
Let me know what you come up with

Jason

Hi Jason N.,

Thx for ur Logical mentor(useful for me). Can u Plz mail me /reply to
this forum,
some rails task that u are running from cron.(with explaination)

Advance Thx

Regards,
Karthick.

You could create a logged-in users table, log their user id an IP. Also
their session ID?
When users log in, check to make sure their user ID isn’t in the table,
then write their connection to the table.
When they log out, delete the entry.
But what if they just disconnect and don’t log out? You’ll need to do
some sort of housekeeping every so often on sessions/logged connections.
I’ve not tackled this problem yet, but you’d probably have to do it from
a cron job. I have several rails tasks that run only from cron and it
works very well.
Let me know what you come up with

Jason

We use a class method call to send mass mailings every morning. Cron
calls a shell script which does something like

/home/rails/emailapplication/script/runner -e production
‘Emailer.send_daily_announcements’

I haven’t done this using an ActionController method, but anything you
want to run from a script should be able to run from a model.
This was just hacked out by a couple of rails noobs, so if anyone has a
better way to do it, I’d love to hear about it.

Jason

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs