Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Session, Flash, Controller Active, Change Controller
  • Hi everyone,

    I have in use this two methods:

    Session::set_flash('in_search',$in_search);
    $in_search = Session::get_flash('in_search');

    And i need delete this flash when controller is changed.
    Anyone can say me how to do this?
    Thanks
  • You don't have to.

    When the session class loads at the start of a request, all session variables present in flash will be marked expired. In that request, their values will still be available.

    When the request is finished, the cleanup will delete all session variables marked expired before the session data is written.

    So unless you set a variable you get again or call keep_flash() for that variable, it will automatically be deleted at the end of the request.

    This distinguishes flash variables from normal variables, which will exist until the session expires or you explicitly delete them.
  • Hi Harro,
    Not work for me. i have product tab and client tab, for example, and when i search "mo" (search method use flash for do pagination with this search on real time) into product, and change to client tab, clients are filtred with "mo" flash almacened.

    But i sort this problem using distinct flash variables.

    Thanks.
  • HarroHarro
    Accepted Answer
    That seems logical, that you use different variables for different search operations.

Howdy, Stranger!

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

In this Discussion