5
I’m wondering how to save an Array of objects in the session, and then how to recover them. Today I use the sessionStorage.setItem("pessoa", arrayPessoa);
and sessionStorage.getItem("pessoa");
, but it is giving null when I send it to the console.
How to solve this ?
You have a similar question here: http://answall.com/questions/72189/problema-com-vari%C3%A1vel-de-session, please check if the answer to this question helps you.
– Tiago Oliveira de Freitas
@Tiagooliveiradefreitas has nothing to do Session in php with sessionStorage in javascript
– Gabriel Rodrigues
It’s @Tiagooliveiradefreitas as Gabriel said, has nothing to do.
– Renan Rodrigues
Where does Session come from? PHP or Java?
– Giancarlo Abel Giulian
@Giancarloabelgiulian actually I do a search in Indexeddb and I want to save the information in the session to be able to access them outside the function onsuccess.
– Renan Rodrigues
Try this, request.getSession(). getattribute("person"), request.getSession(). setAttribute("person", value), but I don’t know if it works with array...
– Tiago Oliveira de Freitas
Only minute to test.
– Renan Rodrigues
Uncaught Typeerror: Undefined is not a Function gave this error
– Renan Rodrigues
It is worth noting that the programming is mobile
– Renan Rodrigues
You can use sessionStorage but have to pass a string to it, or set the Person values one by one, or pass the array in string form
– Tiago Oliveira de Freitas
Make an answer for me to watch how you do
– Renan Rodrigues
Cara to giving a shot in the dark, I’m new in programming, if it doesn’t work I don’t know what could work, I created an answer.
– Tiago Oliveira de Freitas