I'm using HttpListener with my own framework to handle http requests.
Only two requests: sign in and sign up.
While signing up successfully, I will put [id, studentId, name] three cookies in the response cookie, but it turns out only one I will finally put in, that's [id].
Here's my codes where I put my cookies:
private void saveStudentIdentityToCookie(Student student)
{
idCookie = new Cookie("id", student.id) {Expires = DateTime.Now.AddMonths(1)};
nameCookie = new Cookie("name", student.name) { Expires = DateTime.Now.AddMonths(1)};
studentIdCookie = new Cookie("studentId", student.studentId) { Expires = DateTime.Now.AddMonths(1)};
response.AppendCookie(idCookie);
response.AppendCookie(nameCookie);
response.AppendCookie(studentIdCookie);
Log.d(TAG, "Student " + student + " saved into the cookie.");
}
And here's my result, I view it using the google extension - EditThisCookie
It shows that I only got one cookie, please take a look where did I go wrong, thanks a lot.