Beraki Beraki - 1 year ago 59
jQuery Question

How to check if a PHP session is set using jquery?

I have a php application that is working alongside jquery.
I want to check if the user session is still available in the js function.

If a session is set or if not return false.


Multiple ways, if the file is a .php ext. then:

var something = "<?php = $_SESSION['something'] ?>";

If you print the file after file_get_contents() use str_replace

You also can check cookie in javascript, seach for PHPSESSID