Yes, it can be a polite and loving way to say goodbye to someone. This expression can also be used to remind people who are leaving to take care of themselves.