java ee - JSF CDI Bean events on initiation and destruction -


i want record initiation , destruction of jsf cdi sessionscope bean. how can it? (the details user, logged time , log out time needed recorded database.)

for purpose recording creation , destruction of session scoped bean not idea. recording logged in event call logic in login method or fire cdi event when user loggs in successfully. recording logging out recommend implementing httpsessionlistener gets called when httpsession gets invalidated or times out. don't forget invalidate httpsession in logout method.