I have a jQuery function named Update.
If $_SESSSION['Name'] is set, then the Update function of jQuery should be executed.
How can I do that?
Place a check for this in PHP, and if it is set, then print the code to the page to execute the JS function.
<?php
if(isset($_SESSION['Name'])){
//execute the JavaScript/jQuery Update function
?>
<script>
Update();
</script>
<?php
}
jQuery is a frontend technology, whereas PHP (and therefore $_SESSION) are backend technologies. Because of this, jQuery cannot directly access the $_SESSION variable.
You could create a PHP file to check for the existence of the session variable, though, and use an AJAX call to retrieve that information from the frontend.