How is the schedule method called?
If it's called from another thread, you won't have access to any Shiro
facilities
because Shiro keeps it's state in a thread-local manner.
To get that state, the flow has to go through the Shiro filter and associate
the session / principal
with the current thread context.
On Feb 27, 2015, at 4:18 AM, rasel.ahmed wrote:
> Session is there, I have session scope class with scheduler method where I
> can see some log is printed.
> In debug mode, i have checked, principal value became NULL:
>
> Anyway, I have got an solution for the problem :
> public class ActiveSessionsListener implements SessionListener {
>
> @Override
> public void onStart(Session session) {
>
> }
>
> @Override
> public void onStop(Session session) {
>
> }
>
> @Override
> public void onExpiration(Session session) {
> session.stop();
> }
> }
>
> I dont know where is the root cause for generating this problem, but the
> problem stared from SESSION EXPIRE only.
> Upon the code, during onexpire, I call session stop() method. It resolves my
> problem.
> Didn't get real cause why it happens. I am quite confuse, is this any
> problem of SHIRO or not.
>
> Even you remove custom filter, it will not resolve the problem. Because
> Shiro has an authetication checker scheduler. At that it, if the principal
> value is not there, still it will be logged out from the system.
>
>
>
>
> --
> View this message in context:
> http://shiro-user.582556.n2.nabble.com/Shiro-lost-subject-principal-value-tp7580449p7580469.html
> Sent from the Shiro User mailing list archive at Nabble.com.
>