I'm using Alamofire to submit the authentication request like this:
let user = "user"
let password = "password"
Alamofire.request(.GET, "https://httpbin.org/basic-auth/\(user)/\(password)")
.authenticate(user: user, password: password)
.responseJSON { response in
debugPrint(response)
// Aqui verifico se foi autenticado e redireciono para a view principal.
}
My question is, how can I save the authentication so that the user does not have to log in again when I enter the application, in PHP I would use $_SESSION
but in swift
I do not know.