gate maintain login logout state