Maintaining state is really something you need to build into the app, pesumbably Web Advisor. It seems to me probably the only way to do it effectively would be to make a wrapper app for Web Advisor. What you then do is insert your app between the end users and Web Advisor. You do what you want in your app then redirect to Web Advisor to do the actual work.

There are two ways to get this happening. Assuming WebAdvisor is a single.cgi you could just rename it WebAdvisor2.cgi and call your script WebAdvisor.cgi. A call to WebAdvisor.cgi will now go to you where you could in the first instance request the login and fire up a session cookie. Then you track the user via this cookie, logging as you want, and redirect to WebAdvisor to do the work.

That is the most simplistic model. You can also use the Apache mod_rewrite module to seamlessly direct request to your wrapper script. Need to aviod generating an infinite loop here but that is easy enough. Remember each request will now effectively be two part (first rewrites request to WebAdvisor to your script, you do stuff, then redirect to say dont-loop.cgi (does not even have to exist) because you get mod_rewrite to rewrite this to the real WebAdvisor.

The practical mechanics depend on the details but it is quite possible to insert your script into the chain of events. One gotcha is POST data. The usual login will probably be by POST. If you read this in your wrapper STDIN will be empty when the request gets to WebAdvisor. You could try passing the data in a query string or do a pipe open to WebAdvisor and pass the data you stole from STDIN to it that way. There are other ways within Apache to do it as well.

There are other possibilities such as using a proxy server but they are far more convoluted.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: User Tracking in closed source application. by tachyon
in thread User Tracking in closed source application. by rlb3

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.