organized the codes of handling viewdata of user session