Search code examples
fat-free-framework

Use custom session in fatfree framework


I want to use custom session in my fatfree application. I have already running a custom php website here: http://www.example.com and I have installed fat free app under a subdirectory like http://www.example.com/fatfree-app, can you please let me know how I can use my parent site( http://www.example.com) session under http://www.example.com/fatfree-app.

In my parent site I'm setting session in this way:

 $_SESSION['access'] = TRUE;
 $_SESSION['userid'] = $objUser->userid;
 $_SESSION['role_id'] = $objUser->role_id;
 $_SESSION['team_id'] = $objUser->team_id;
 $_SESSION['uname'] = $objUser->uname;
 $_SESSION['name'] = $objUser->name;
  1. How can I disable built-in session in fat-free framework?

Thank you in advance.


Solution

  • Well, you could use f3's build in sync function.

    $f3->sync('SESSION'); // ensures PHP global var SESSION is the same as F3 variable SESSION
    

    And to disable it just set Session to false in the system variables.

    $f3->set('SESSION', FALSE);