How to access logged in user data with jQuery via the API

Hello.

I have a login form on page 1. It checked for credentials and, on success, it redirects to page 2.

I understand there is a JSON response with the user data.

I need to use that information in page 2. I haven't found a way to use that data with either PHP and jQuery.

PAGE 1

<script >
$('.send').click(function(event) {
    var email = $("#email").val();
    var pass = $("#password").val();
    var data = {
		'email' : email ,	
		'password' : pass
	}
        // replace XXX with your application ID
	$.ajax({
	url: "https://api.knackhq.com/v1/applications/XXX/session",
	type: "POST",
	headers: {"X-Knack-Application-Id": "XXX", "X-Knack-REST-API-Key": "XXX"},
	data: data,
	success: function(response) { 
		alert('Sesion Successful and Redirect!');
		}
	});
});
</script>

<form>
    <label>
    	<input type="email" name="email" id="email" />
    </label>
    <label>
    	<input type="password" name="password" id="password" />
    </label>
    <a href="#" class="send">Enviar</a>
</form> 

PAGE 2


??


I have no clue as to how to use the results.

Are they stored in the user session? A cookie?

Thank you.

I had to rephrase this problem, but can't edit the text.

The new forum topic is here: http://helpdesk.knackhq.com/support/discussions/topics/5000059081

The documentation says that the response will be in JSON format. I just need to know how to retrieve it.

"This endpoint will return a JSON object containing various information about the user:"


http://helpdesk.knackhq.com/support/solutions/articles/5000528001-working-with-the-logged-in-user#remote