What I'm trying to do is make a web app that has a Service Worker installed to show push notifications to the user using Push Notifications API on Chrome and Firefox.
But I don't know if this can be done when user session expires, because server side sessions are closed after three hours. ¿It is possible that service worker continues to show notifications based on a cached user maybe, or it requires that the user is being logged in. I know it may not be very good to normal end users, but this is an internal system so it doesn't matter if they keep getting notifications all day.
Using Service Workers and the Push API, you can send and show notifications whenever you want. There isn't the concept of log in
, you can send a notification to any user that accepts to be notified (N.B.: the browser prompts the user for permission).
To clarify your understanding, you could take a look at the demo here: https://serviceworke.rs/push-simple.html