This is made in order to prolong sessio, but not for each http request. This can skip session prolongation if expiration time is quite enought. You can devide it by some other constant. 

About minute you are right. "validTo.Minute - validFrom.Minute" shuold be "validTo.TotalMinutes - validFrom.TotalMinutes"