A cross-linkable chitosan composition that comprises (i) randomly deacetylated chitosan having a degree of deacetylation between 30 and 75 percent and (ii) a cross-linking agent. The molar ratio of the cross-linking agent to the chitosan is 0.2:1 or less based on the number of deacetylated amino groups in the chitosan. The composition can produce a chitosan hydrogel that can be used in pharmaceuticals, in the food industry, as a glue, as a lubricant or as a drilling servicing fluid.