Hi Oliver,
Shiro's session listeners only work when you use Shiro's native
session support ('native' session mode). The servlet container won't
trigger these types of events.
Also, Session events are triggered only when sessions are started,
stopped, or expired. They are not related to RememberMe
functionality. There currently aren't any events triggered when a
remembered user is associated with a session - if you need this,
please open a Jira issue for it.
There are AuthenticationListeners in Shiro as well, which might suit
your needs however. But note that AuthenticationListeners are only
notified during an authentication attempt - remember me is not an
authentication attempt.
What are you trying to accomplish? Maybe I can offer a suggestion
based on your needs.
Cheers,
Les
On Tue, Feb 9, 2010 at 12:23 PM, oliverw <[email protected]> wrote:
>
> Hi
>
> I'm using the Grails Shiro Plugin in my Grails Project and I'm having
> trouble to wiring my own SessionListener to the shiroSecurityManager to keep
> track of who logins in:
>
> my resources.groovy:
> beans =
> {
> myShiroSessionListener(MySessionListener) {
> }
> }
>
>
> This is my bootstrap:
>
> class BootStrap
> {
> def init =
> {servletContext ->
> def ctx =
> servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT)
> def shiroSecurityManager = ctx.getBean('shiroSecurityManager')
> def myShiroSessionListener = ctx.getBean('myShiroSessionListener')
> shiroSecurityManager.add(myShiroSessionListener)
> }
> }
>
> The application starts up fine but my listener is never called. Any
> suggestions?
>
> Btw: Is the listener supposed to be called when a user logs in via
> rememberMe cookie?
> --
> View this message in context:
> http://n2.nabble.com/Wiring-a-SessionListener-in-a-Grails-Application-tp4542495p4542495.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>