create logic for secure session and added some auxiliary functions
some fixed in calling function for secure session
added logic for checking token