merged some code form issue 1534 Session ID not changed after privilege level change, thanks kablubr