Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Extra Data Returned when Api with Session set is called
  • I have a project that I am working on my other PC. I normally put my projects in my skydrive folder so that projects would sync. Though I would normally use github, but since I am doing this project myself, I thought that I should just put it on gitHub when everything on the code is complete.

    Anyway, on my other PC it was working fine. I have a typical login page that works fine. But when I access my project on my laptop, I notice that there is a garbage data being sent along with the json response. (i.e: I use ajax form). Upon checking, I notice that the garbage only happens when I have the part where I set the session for the logged user. When I commented them (line 29 - 33), the API works fine.

    Have other projects on my laptop pc using the same technique and they are working fine.

    Here is the code:
  • I don't see anything strange about the code. And as far as I'm aware Session doesn't output anything.

    Are you using output compression? If so, there might be some error message attached, that is converted to rubbish by the decompression code client side.
  • How do I check that?
  • If you have an error, warning or notice, it should be recorded in your apache log.
  • Here the logs.

     

    [Sat Nov 09 20:02:35.120459 2013] [ssl:warn] [pid 4296:tid 244] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:02:35.161461 2013] [core:warn] [pid 4296:tid 244] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
    [Sat Nov 09 20:02:35.604486 2013] [ssl:warn] [pid 4296:tid 244] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:02:35.645489 2013] [mpm_winnt:notice] [pid 4296:tid 244] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3 configured -- resuming normal operations
    [Sat Nov 09 20:02:35.645489 2013] [mpm_winnt:notice] [pid 4296:tid 244] AH00456: Server built: Feb 23 2013 12:42:00
    [Sat Nov 09 20:02:35.645489 2013] [core:notice] [pid 4296:tid 244] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
    [Sat Nov 09 20:02:35.647489 2013] [mpm_winnt:notice] [pid 4296:tid 244] AH00418: Parent: Created child process 9616
    [Sat Nov 09 20:02:36.641546 2013] [ssl:warn] [pid 9616:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:02:37.169576 2013] [ssl:warn] [pid 9616:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:02:37.222579 2013] [mpm_winnt:notice] [pid 9616:tid 256] AH00354: Child: Starting 150 worker threads.
    [Sat Nov 09 20:05:58.072067 2013] [ssl:warn] [pid 10176:tid 244] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:05:58.113069 2013] [core:warn] [pid 10176:tid 244] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
    [Sat Nov 09 20:05:58.512092 2013] [ssl:warn] [pid 10176:tid 244] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:05:58.553094 2013] [mpm_winnt:notice] [pid 10176:tid 244] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3 configured -- resuming normal operations
    [Sat Nov 09 20:05:58.553094 2013] [mpm_winnt:notice] [pid 10176:tid 244] AH00456: Server built: Feb 23 2013 12:42:00
    [Sat Nov 09 20:05:58.553094 2013] [core:notice] [pid 10176:tid 244] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
    [Sat Nov 09 20:05:58.554095 2013] [mpm_winnt:notice] [pid 10176:tid 244] AH00418: Parent: Created child process 10200
    [Sat Nov 09 20:05:59.432145 2013] [ssl:warn] [pid 10200:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:05:59.947174 2013] [ssl:warn] [pid 10200:tid 256] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
    [Sat Nov 09 20:05:59.986176 2013] [mpm_winnt:notice] [pid 10200:tid 256] AH00354: Child: Starting 150 worker threads.

  • Update. I tried doing session in non fuel way...

     

    start_session();

    $_SESSION['email'] = 'some@email.com';

    print_r($_SESSION)

    This one is also not working. I thought it was, but it doesn't.

  • I found the problem. I just deleted the crypt.php and everything worked. Perhaps since I has problems overwriting the file that came from another computer.
  • No errors in the log.

    Are you testing using a real REST call, or via the browser? You can also modify your index.php, and log the result of the request to a file before echo'ing it out. Then you can see exactly what Fuel has generated.
  • HarroHarro
    Accepted Answer
    If you use cookie sessions, crypt is used to encrypt the session cookie. So it could indeed be an error due to an invalid crypt config (or the absence of file rights to create or update the crypt config).

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion