My program is basically a form. After the user presses the submit button, the program does input error checking (so I can't use the action element in form to call a new program). After error checking I call another program using header("Location: url").
The problem is I lose all my session data. I have session_start() as the first line in both programs, I use $_SESSION['variable name'] to name some variables. My form uses the POST method.
My POST variables exist after the user presses submit but they are lost also after the header() call - along with my $_SESSION[''] variables. My session_id is the same for both programs. I have tried session_write_close() just before the header() statement - still lose the data.
How do I keep my variable data?
session_id()in both scripts. if the value's changing, then you're getting a different session in each script, and you'll have to figure out why (probably a cookie setting problem).