Storing a JSON Object into a session.set variable?


#1

Hi Everyone,

I am saving a JSON object into a Session.set variable but the session.get variable only shows me [object Object]. Am I doing something wrong here? posting an example below of what the object contents are… there are many of these that i have currently stored on a data.response variable

0: Object case_owner: "Joe" case_owner_description: "clown" city: "Jamaica" created_year_month: "20131" goal_days: "30" issue_type: "cant put on red nose" latitude: "25.511178"


#2

How are you getting the data out and displaying it?


#3

i get the data from an api call. and am displaying it on the webconsole.

The data.response variable will give me a listing of objects with the above details, but when i put the data.response variable inside a session.set variable i get [object Object] on calling console.log(Session.get(‘giveMeMyObjects’);


#4

Well, object in browser can be clicked to open most of the time.
Are you trying to display it with some string ? like console.log(‘here:’ + Session.get…) ?


#5

Hi Shock,
Thanks, it looks like even though it does not display in web console the object does actually get saved into a Session variable and the contents are accessible :slight_smile: woohoo