Merge create_session decoding fix into for-2.6.39

This needs a further fixup!