I am using jquery's .post ajax call to pull an form input value and pass it to a php file that starts a session and stores the value in it. The session value is then called on a different page.
The problem is, this all takes place without a page refresh, so the session value is always one page refresh behind. I.E. the first time the session value is called it is blank, but after refresh the value is loaded with the initial input value. When refreshing again, the session's second value is pulled. So, the session value is never current... it is one behind.
How can make it so the php session variable is current without needing to do a refresh?
Or, if this needs to be solved with a refresh, what is the best way to go about it?
Thanks for your help!