title: Flutter http Maintain PHP session
body: <p>I'm new to flutter. Basically I'm using code Igniter framework for my web application. I created REST API for my web app, after user login using API all the methods check for the session_id if it exists then it proceeds, and if it doesn't then it gives</p>
  
  <pre><code>{ ['status'] = false, ['message'] = 'unauthorized access' }
  </code></pre>
  
  <p>I'm creating app with flutter, when i use the http method of flutter it changes session on each request. I mean, it doesn't maintain the session. I think it destroys and creates new connection each time. Here is thr class method which i use for api calls get and post request.</p>
  
  <pre><code>class ApiCall {  
    static Map data;
    static List keys;
  
  static Future&lt;Map&gt; getData(url) async {
   http.Response response = await http.get(url);
   Map  body =  JSON.decode(response.body);
   data = body;
   return body;
  }
  
  static Future postData(url, data) async {
  Map result;    
  http.Response response = await http.post(url, body: data).then((response) {
    result = JSON.decode(response.body);
  }).catchError((error) =&gt; print(error.toString()));
  
  data = result;
  keys = result.keys.toList();
  
  return result;  
  }
  </code></pre>
  
  <p>I want to make API request and then store session_id, 
  And is it possible to maintain session on the server so i can manage authentication on the web app it self.?</p>