AngularJs and module usage

I’d like to use angularJs inside my module. How can I handle session expiration?

I’m planning to use a rest component as done before, but would like to know how can I be sure that the user is logged in.