Add session plugin, make some improvement