Session: Do not write session on every request

This speed up the gui by at least 20%.