A device (40; 101) for communicating with a network, comprising: a communications unit for sending and receiving data; a storage unit for storing data; and a control unit for controlling operation of the communications unit and storage unit; wherein the device is configured so that a secret and a random value have been used to establish a first security context with a serving network node (50; 102), assisted by an authentication server, the secret stored by an identity module associated with the device and shared with the authentication server; and wherein: the storage unit is configured to store at least one of the random value and a first re-use information associated with the first security context; the control unit is configured so that, if the device requires secure communication with the network and it is known or suspected that the first security context is not available in the network outside the authentication server or device, the control unit generates a context regeneration request authenticated at least partly based on the secret; the communications unit is configured to send the context regeneration request towards the serving network node or another serving network node; the control unit is configured to generate a second security context based on at least the secret and at least one of the first re-use information and second re-use information; and the control unit is configured to use the second security context to protect data exchanged with the network. a communications unit for sending and receiving data; a storage unit for storing data; and a control unit for controlling operation of the communications unit and storage unit; wherein the device is configured so that a secret and a random value have been used to establish a first security context with a serving network node (50; 102), assisted by an authentication server, the secret stored by an identity module associated with the device and shared with the authentication server; and wherein: the storage unit is configured to store at least one of the random value and a first re-use information associated with the first security context; the control unit is configured so that, if the device requires secure communication with the network and it is known or suspected that the first security context is not available in the network outside the authentication server or device, the control unit generates a context regeneration request authenticated at least partly based on the secret; the communications unit is configured to send the context regeneration request towards the serving network node or another serving network node; the control unit is configured to generate a second security context based on at least the secret and at least one of the first re-use information and second re-use information; and the control unit is configured to use the second security context to protect data exchanged with the network. the storage unit is configured to store at least one of the random value and a first re-use information associated with the first security context; the control unit is configured so that, if the device requires secure communication with the network and it is known or suspected that the first security context is not available in the network outside the authentication server or device, the control unit generates a context regeneration request authenticated at least partly based on the secret; the communications unit is configured to send the context regeneration request towards the serving network node or another serving network node; the control unit is configured to generate a second security context based on at least the secret and at least one of the first re-use information and second re-use information; and the control unit is configured to use the second security context to protect data exchanged with the network.