You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by hi...@tlen.pl on 2004/09/03 10:08:59 UTC

Form based authentication - "last login"

Hi All,

I'm supposed to record the last login timestamp.
IMHO the best sollution would be to intercept the authentication process (I'm working with Tomcat 4.x), to smuggle some custom code there that updates the appropriate column in the database. The question is.. how can I do this?? Or maybe someone has a better idea how to do this??

Thanx in advance for your suggestions
Chris


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Form based authentication - "last login"

Posted by QM <qm...@brandxdev.net>.
On Fri, Sep 03, 2004 at 10:08:59AM +0200, hicnar@tlen.pl wrote:
: IMHO the best sollution would be to intercept the authentication process (I'm working with Tomcat 4.x), to smuggle some custom code there that updates the appropriate column in the database. The question is.. how can I do this?? Or maybe someone has a better idea how to do this??

There are several ways to do this, I'm sure.  My preferred method:

map a Filter to the protected area(s) that checks for the presence of
some session object.  If the object isn't there, the person has just
logged in, so you record the timestamp and store the object.  Otherwise,
the person's already logged in and the filter can pass the
request/response down the chain.

The marker object needn't be anything special: a simple Boolean will do,
if you don't store any other objects for users who are logged in.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org