Cook - wearing a new ECB-compliant helmet - was dropped on one by Danny Briggs off the bowling of Ollie Robinson as Essex were set 329 to win on the final day, after the home side added just six runs to their overnight score of 282.
Essex did lose Nick Browne cheaply in the third over, as well as Tom Westley (16) and Ravi Bopara (28) before lunch, but a 103-run partnership between Cook and Jesse Ryder (35) for the fifth wicket seemed to be saving them.
Three wickets for 20 runs late in the day left Essex with just over 10 overs to negotiate, but Cook - who now has two hundreds in his two first-class games for his county in 2016 - saw them safely to the close.
Resuming the day on 172-8, Glamorgan added only 19 more to their total as Ben Raine (4-57) swiftly removed Michael Hogan (23) and Graham Wagg (33) was run out.
Leicestershire made light work of their 113-run target as openers Angus Robson (49no) and Paul Horton (64no) saw them home.
Gloucestershire's game with Derbyshire played out to an inevitable draw on day four in Bristol.
Derbyshire reached 260-2 in their second innings, with a lead of 141, when the teams shook hands late on the final day, Chesney Hughes unbeaten on 137 to go with his first-innings 96.
Hughes put on 174 for the second wicket with Hamish Rutherford (78), helping the visitors recover from the loss of Ben Slater, who was run out for six in the fourth over over their innings.