try to not write into session unless there is really a change or a refresh needed, reduce code duplication

move code from HomeView to context processor