无法访问在jquery中设置的php中的会话

I have created a session in jquery using following code

$.session.set("name","xyz");

Now when i try to access the session 'name' in php i cant

$name=$_SESSION['name'];

it is not possible because they are different context.

PHP doc http://php.net/manual/fr/reserved.variables.session.php

jQuery doc https://plugins.jquery.com/tag/session/

What you are probably looking for (the answer) Read session value with Javascript

$.session.set stores the data in the browser something like a local storage which is accessible across multiple pages from the same site during a browser session. This data stored and accessible on the browser.

But a PHP session variable is stored and accessible in the server. So you cannot access a value stored in jquery session from a PHP session. Hope it clears your confusion