Link to home
Start Free TrialLog in
Avatar of InNoCenT_Ch1ld
InNoCenT_Ch1ld

asked on

noob j_security_check question.

1. to login, i use j_security_check... but what a bout logout?
2. If i wanted to keep track on which user login at what time, how do i insert the code in j_security_check so that it will do so?

Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Oddly, logout doesn't really have a definition.

What we do is clear all the session attributes, clear the cookies, and destroy the session.  It has the desired effect.

You can't insert code into j_security_check -- it's entirely internal to Tomcat and has no public interface.

What you have to do is add code to your login handling to set data in a database, or sessions, or wherever you keep data, to keep track of your users.  We log it to a database, for example.

Avatar of InNoCenT_Ch1ld
InNoCenT_Ch1ld

ASKER

but if i define the action to be the j_security_check already, where am i suppose to add my code to?
ASKER CERTIFIED SOLUTION
Avatar of mrcoffee365
mrcoffee365
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
tks
You're welcome.

This is an area everyone has to work through, and there are a few different ways to use the login feature from Tomcat.  Post another question back on EE if you get stuck again.

Good luck!
i'm using jdbcrealm with digest.. but i cant get it to work. if you know how, let me know, i will open a question.
I haven't used it, but I've used login with Tomcat a lot, and I'm sure there are other people at EE with specific jdbc realm and digested password experience.  So sure, post the question.

When you do, it would help a lot if you posted the jdbc realm definition in your server.xml, the security parts of your web.xml, the login code you're trying to make work, and the error message you're getting.  Obfuscate any parts of the code you need to -- although I don't think that any of this should be an issue, unless IP addresses are involved somewhere.