Added Phpdoc, created specialFunction, moved cleanSessions inside specialFunction
Added security