title: One PHP file can't see the change of session variable done by another PHP file
body: <p>Session variable <code>login</code> is used both by <code>form.php</code> and <code>ajaxfunc.php</code>. The value of the variable is set by <code>function changeLogin()</code> from <code>form.php</code>. To read the value of this variable both files use <code>function readLogin()</code> which is located in the file <code>shared.inc.php</code>. File <code>form.php</code> starts with <code>session_start();</code> and then includes <code>shared.inc.php</code>. File <code>ajaxfunc.php</code> also includes <code>shared.inc.php</code> and designed to be used by AJAX requests from JS functions inside <code>form.php</code>. The problem is that whenever the form changes the session variable, <code>readLogin()</code> invoked from <code>ajaxfunc.php</code> always returns the same old initial value of <code>login</code>. How can I get the updated value of the session variable?</p>