A computer program product stored in a non-transitory computer-readable medium, which comprises program code instructions for implementation of a method to connect to an access point implemented in a mobile terminal present in a cellular network formed by a plurality of cells each controlled by an access point, wherein the method comprises the following steps:
- locating said mobile terminal inside a current cell and transmitting information on location to a mobility controller;
- receiving by anticipation a target context comprising at least one identifier of at least one access point towards which the mobile terminal is likely to move, the identifier of said at least one access point comprising a MAC address and an SSID identifier, said target context further comprising information required by said mobile terminal to connect to said at least one access point and, for a given access point of said at least one access point, an address of said mobile terminal, said target context being received by said mobile terminal only when said mobile terminal is in the vicinity of a target cell, according to a predetermined criterion of location.