update mysql interaction, full session management