Your remaining Rested time pauses when you log out.

Sunshine Alley remembers the remaining Rested duration for your character and world when you disconnect, then restores it when you reconnect. It is kept in the running server's memory, so a server restart will clear the saved duration.