-->
Page 1 of 1

ESP8266 + Arduino - SPIFFS + Simple Autentification

PostPosted: Mon Dec 12, 2016 12:32 pm
by ViniciusKruz
Hi,

Simple authentification example for Arduino IDE work 100% but if i insert the funcions of SPIFFS, authentification fail, not read the cookie:


Authentification:
Code: Select all//Check if header is present and correct
bool is_authentified(){
  Serial.println("Enter is_authentified");
  if (server.hasHeader("Cookie")){   
    Serial.print("Found cookie: ");
    String cookie = server.header("Cookie");
    Serial.println(cookie);
    [color=#FF0000]if (cookie.indexOf("ESPSESSIONID=1") != -1) {
      Serial.println("Authentification Successful");
      return true;
    }[/color]
  }
  Serial.println("Authentification Failed");
  return false; 
}


The red code not enter if activate SPIFFS:

#include <FS.h>
SPIFFS.begin();

This is a bug?

Sorry for my english.

Thanks!!