How to keep a json in memory or cache with angularjs?

I have a angularjs app which reads json from java when the user is logged in:

$http({ method: 'POST', url: 'ws/login/user', data : user, cache: true })
.success(function (response) {                                                    
    $rootScope.userInfo = response; // Here I get the json                                          
    response = { success : true };                    
    callback(response);
}).error(function (response) {
    response = { success : false };
    response.message = 'Error.';
    callback(response);
});

Everything works fine until I press F5, then the JSON disappears.

How can I keep the data between page loads?

You can use cookies or Local Storage. A quick google search shows this library: https://github.com/grevory/angular-local-storage.

Modern web applications will use local storage to keep data between page loads. Here is a helpful answer to get you started.

How to store the data to local storage?