I have one PHP script with a session variable, set like so:
$_SESSION[\'VAR1\'] = \"test\"
Now, I am using AJAX via a jQuery-initiated POST
Make sure that the domain names for both pages (i.e. the AJAX container and the AJAX script are same). Here is an example:
http://mydomain.com/login.php (set session variables here)
http://mydomain.com/ajax-container.php (session variables are visible here)
http://mydomain.com/ajax-script.php (session variables are visible here)
http://www.mydomain.com/ajax-script.php (session variables are NOT visible here)
Another one:
http://www.mydomain.com/login.php (set session variables here)
http://www.mydomain.com/ajax-container.php (session variables are visible here)
http://www.mydomain.com/ajax-script.php (session variables are visible here)
http://mydomain.com/ajax-script.php (session variables are NOT visible here)