[fix] Encoding for SMS + logic error for 2nd sess cache