This function only casts t->context to (struct session *). It will avoid some ugly and unsafe casts in upcoming changes.