[eluser]WanWizard[/eluser]
Not entirely sure what you're trying to say.
Every request to the server, either by the browser itself or by an AJAX request, will sent the session cookie to the server. Using this cookie, CI can relate the request to the correct session. When the answer is sent back to the browser (or the AJAX request), the cookie is sent back with it, in the HTTP header. So both requests (what you call page 'a' and 'b', what I assume to be different controllers) will have access to the same session information.
Offcourse, controller 'a' won't know anything about what controller 'b' is about to do, since it executes after 'a' was finished. I don't understand what you mean with 'writing a cookie value in a div'. You mean session variable? If I understand you correctly 'b' results in an AJAX response to a script in the page generated by 'a'. So naturely scripts in 'a' will have access to whatever result was sent back...