Backgroundrb and authorization/sessions

Hi,

I have a backgroundrb task that performs a long running task initiated
through a website. The website also uses authorization to log users on,
and to record/audit who changes which record.

What is the easiest way for my background tasks to pick up that
information from the session of the logged in user … or is this
something I will need to pass into the do_work method?

Thanks
Joerg

Joerg D. wrote:

I have a backgroundrb task that performs a long running task initiated
through a website. The website also uses authorization to log users on,
and to record/audit who changes which record.

What is the easiest way for my background tasks to pick up that
information from the session of the logged in user … or is this
something I will need to pass into the do_work method?

Pass the ID of the user into the worker’s construction parameters, and
let
the background task pick everything else up from the database.

Your question suggests you might be abusing the session[] hash. Only use
it
for data that belong only to one series of pages in one web browser.
Don’t
use it to avoid sticking important information into the database.


Phlip
"Pigleg too?", week 1