PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Clear custom $_session variable on form submit

  1. Hi,

    Can anyone help me to clear some $_SESSION data when I submit a specific form. I have tried using this hook (gform_after_submission) but can figure this out.

    EG code

    add_action("gform_after_submission", "empty_session_data", 10, 2);
    function empty_session_data($entry, $form){

    //getting post
    if($entry["post_id"] == 111) {
    unset($_SESSION['interested']);
    }
    }

    Thanks

    Posted 11 years ago on Friday April 19, 2013 | Permalink