What causes this, and is it okay?
This is actually quite common and, as far as I know, completely normal. It has to do with the various components of the semen mixing when you ejaculate, which causes the fluid to thicken – sometimes into an almost semi-solid form.