I love coriander and haven't had a problem growing it in pots or the ground, but what you must do, is to regularly pick leaves for eating, or pinch leaves off to make it appear, that it's appreciated. - Andy_Mann
If they're packed in too close together they can get stressed and go to seed. If that's not the issue, perhaps try mulching to keep the soil temp down. Harvesting often is also a good point, the more you pick the more the plant will grow! - Emily
Picking regularly and mulching will both help. Coriander will always bolt and flower in hot weather but you can definitely work to keep your plant for as long as possible by constant harvesting and keeping the soil as moist and cool as possible. Also, make sure you get a "slow bolt" variety and plant every few weeks rather than all at once so you get a constant supply for as long as possible.
If you are going to lose a plant to seed, wait until the majority of the seed turns brown. Then cut off the seed heads along with a few inches of stalk and hang them upside down in a brown paper bag.
When the seeds are fully dry after a few weeks, they will fall out of the heads and into the bottom of the bag. Store the dry seed in a jar with a lid and keep in a cool place like a pantry. - greygardener