I'm needing some help understanding sessions. I have a form on a page that a will be used to search a database. I am using the following code to initiate my session:
if (isset($_SESSION['_submit_check'])) {
unset($_SESSION['_submit_check']);
}
if (isset($_SESSION['search'])) {
unset($_SESSION['search']);
}
session_start();
if ($_POST['_submit_check']) {
process_form( );
}
If the user uses their back button or comes back to the form I am unsetting the $SESSION['search'] and $SESSION['submit_check'] to clear the settings. Since the code to process the form is contained in the same php file as the form itself, if I do not unset submit_check, the form sort of keeps resubmitting every time the user uses their back button or comes back to the page.
Now sometimes the site runs extremely slow. The page will hang at a blank screen for sometime several minutes before loading. Also, I sometimes get the "Page Expired" warning. Sometimes when using the forward and backwards button, the search results page will change from having several listings to only one.
I'm fairly certain that my problem is with the sessions as the site worked fine before I started implementing them. I do have session_start() at the beginning of each page.
Does anyone have any thoughts that can help lead me in the direction of getting these problems reseolved?
Thanks!