title: Flutter retrieval of data broken when using session?
body: <p>This is how i view the result from php.</p>
  <blockquote>
  </blockquote>
  <pre><code>final String uri =
  'My PHP FILE';
  Future&lt;List&lt;Dbjobs&gt;&gt; dbgetdbusers() async {
  var response = await http.get(uri);
  if (response.statusCode == 200) {
  final items = json.decode(response.body).cast&lt;Map&lt;String, dynamic&gt;&gt;();
  List&lt;Dbjobs&gt; dbusers = items.map&lt;Dbjobs&gt;((json) {
  return Dbjobs.fromJson(json);
  }).toList();
  print(dbusers);
  return dbusers;
  } else {
  throw Exception('Failed to load data.');
  }
  }
  @override
  Widget build(BuildContext context) {
  return FutureBuilder&lt;List&lt;Dbjobs&gt;&gt;(
  future: dbgetdbusers(),
  builder: (context, snapshot) {
  if (!snapshot.hasData)
  return Center(child: CircularProgressIndicator());
  return ListView(
  children: snapshot.data
  .map((data) =&gt; Column(
  children: &lt;Widget&gt;[
  GestureDetector(
  onTap: () {
  Navigator.push(
  context,
  MaterialPageRoute(
  builder: (context) =&gt; JobDetails()));
  },
  child: Column(
  children: &lt;Widget&gt;[
  Container(
  color: Colors.grey,
  child: Column(
  children: &lt;Widget&gt;[
  Align(
  alignment: Alignment.topLeft,
  child: Text(
  data.dateCreated,
  style: TextStyle(fontSize: 30.0),
  ),
  ),    
  </code></pre>
  <p>My Login Php</p>
  <blockquote>
  </blockquote>
  <pre><code>&lt;?php
  session_start();
  include 'testConz.php';
  $username = $_POST['Username'];
  $password =md5($_POST['Password']);   
  $Consult = $connect -&gt; query(&quot;SELECT * FROM tuser_ppim WHERE LoginName = '$username' and Password = '$password' &quot;);
  $Result = array();
  while ($extractData=$Consult-&gt;fetch_assoc()) {
  $Result[] = $extractData;
  }
  $ID = $Result['0']['ID'];
  $_SESSION['$Consult'] = $Result;
  echo json_encode($Result); 
  ?&gt;
  &gt;
  </code></pre>
  <p>This php file works with flutter, there are results based on the query.</p>
  <pre><code>&lt;?php
  session_start();
  include 'testConz.php';  
  $Consult1=$connect-&gt;query(&quot;
  SELECT * FROM tjob WHERE AssignedTo = '6';
  &quot;);
  $Outcome1 = array();
  while ($extractData=$Consult1-&gt;fetch_assoc()) {
  $Outcome1[] = $extractData;
  }
  echo json_encode($Outcome1);
  ?&gt;
  &gt;
  </code></pre>
  <p>This one makes my screen loads with no result. any ideas?</p>
  <pre><code>&lt;?php
  session_start();
  include 'testConz.php';
  $userDetails = $_SESSION['$Consult'];
  $SesID = $userDetails['0']['ID']; 
  $Consult1=$connect-&gt;query(&quot;
  SELECT * FROM tjob WHERE AssignedTo = &quot;.$SesID.&quot;;
      &quot;);
  $Outcome1 = array();
  while ($extractData=$Consult1-&gt;fetch_assoc()) {
  $Outcome1[] = $extractData;
  }
  echo json_encode($Outcome1);
  echo json_encode($userDetails);
  ?&gt;
  &gt;
  </code></pre>
  <p>BTW both produces the number for AssignedTo is equal 6
  AND
  Both produces the same result when in browser. but when it is in flutter screen the other one has no result.
  Thank you!</p>