refactor flash
add sign in/out and permenant sessions