Fix sessio nsecurity problem with custom counters