parse session method copied from ck handler