A method comprising: receiving, at a gateway and from a client device , a first request for a resource , the first request comprising a location identifier associated with the requested resource , the first request comprises an HTTP request; transmitting, by the gateway and to the client device , a redirection message, the redirection message redirecting the first request to an authentication device that requests credentials for authentication, and the redirection message comprising a resource-identification cookie which comprises the location identifier as a value of the resource-identification cookie; storing, by the client device , the resource-identification cookie comprising the location identifier; receiving, at the authentication device and from the client device , the resource-identification cookie and the credentials for authentication; extracting, by the gateway and after authentication of the credentials, the location identifier from the resource-identification cookie; after authentication of the credentials and after the location identifier is extracted from the resource-identification cookie provided by the client device , expiring, by the gateway , the resource-identification cookie; transmitting, by the gateway , after the authentication of the credentials, and to the client device , a session cookie; receiving, by the gateway and from the client device , a second request for the resource comprising the session cookie and the location identifier of the requested resource ; retrieving, by the gateway , the location identifier of the resource from the second request; and providing access, via the gateway , to the resource based on the location identifier. receiving, at a gateway and from a client device , a first request for a resource , the first request comprising a location identifier associated with the requested resource , the first request comprises an HTTP request; transmitting, by the gateway and to the client device , a redirection message, the redirection message redirecting the first request to an authentication device that requests credentials for authentication, and the redirection message comprising a resource-identification cookie which comprises the location identifier as a value of the resource-identification cookie; storing, by the client device , the resource-identification cookie comprising the location identifier; receiving, at the authentication device and from the client device , the resource-identification cookie and the credentials for authentication; extracting, by the gateway and after authentication of the credentials, the location identifier from the resource-identification cookie; after authentication of the credentials and after the location identifier is extracted from the resource-identification cookie provided by the client device , expiring, by the gateway , the resource-identification cookie; transmitting, by the gateway , after the authentication of the credentials, and to the client device , a session cookie; receiving, by the gateway and from the client device , a second request for the resource comprising the session cookie and the location identifier of the requested resource ; retrieving, by the gateway , the location identifier of the resource from the second request; and providing access, via the gateway , to the resource based on the location identifier. <EOS>