add boundary check
Merge branch 'R_2_0'
unfold cookie tests and fix variable type inconsitency
rm phpunit.phpt
simplify
Merge branch 'R_2_0'