In this paper we consider a wireless network consisting of various nodes, where transmissions are regulated by the slotted ALOHA protocol. Nodes using the protocol behave autonomously, and decide at random whether to transmit in a particular time slot. Simultaneous transmissions by multiple nodes cause collisions, rendering the transmissions useless. Nodes can avoid collisions by cooperating, for example by exchanging control messages to coordinate their transmissions. We measure the network performance by the long-term average fraction of time slots in which a successful transmission takes place, and we are interested in how to allocate the performance gains obtained from cooperation among the nodes. To this end we define and analyze a cooperative ALOHA game. We show that this type of game is convex and we consider three solution concepts: the core, the Shapley value, and the compromise value. Furthermore, we develop a set of weighted gain splitting (WGS) allocation rules, and show that this set coincides with the core of the game. These WGS allocation rules can be used to provide an alternative characterization of the Shapley value. Finally, we analyze the sensitivity of the cooperative solution concepts with respect to changes in the wireless network.