Session lives in the document header, which is refreshed only on page load.
When you load A, it stores $_SESSION.

So A is the page running iUI, doing ajax calls to B  or C.

When asking B from A, B is loaded so its header (and PHP session) is
updated.
Not A's since it's not reloaded.
So when asking C *from A*, it uses the session of A, not the one B changed.

Best way to get an updated variables is to:
- reload A so header / session is updated
- use a JS variable in A you update with B ajax call result


Remi


On Wed, Mar 14, 2012 at 2:52 PM, Fibo <[email protected]> wrote:

> Just to be clear: I stumble on a PHP related problem, for which I have not
> (yet) found a PHP explanation.
> So I am exploring that the problem might result from *my* use of iUI.
>
>
> Short form: what might lead $_SESSION content to change between several
> PHP pages?
>
> Background:
> From an HTML/javascript/iUI page I am calling PHP scripts A, later B,
> later C. These scripts are called thru submitting forms with POST.
>
> 1 - In A.php I define values in $_SESSION, and luckily they are stil there
> when later script B is called: this matches the expected session handling.
> While in B.php I place some values in the $_SESSION array, eg
> $_SESSION['my_data']='in Form B';
> After setting up these values, check if this worked by displaying the
> $_SESSION array.
>
> 2 - After control returns to the client, script C.php is called... but
> $_SESSION contents look the same than after script A, ie as if what has
> happened in B.php... was cancelled or ignored.
>
> Any idea? In which situations do you think this might happen?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "iPhoneWebDev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/iphonewebdev/-/KOnw9NU2f4MJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/iphonewebdev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=en.

Reply via email to