store session variable and access it through javascript? In drupal, how do you store/read session variables? Also, how can i access a stored session variable through javascript? 

I'm trying to store whether if a user has closed my modal or not so it doesn't pop up for another day.
Accessing a session variable in Drupal is not different from how it is done with plain PHP: with $_SESSION.

As for reading them with JavaScript, it is enough to use code similar to the following one.

// PHP
drupal_add_js(array('myModule' =&gt; array('key' =&gt; $_SESSION['key'])), 'setting');


// JavaScript
key = Drupal.settings.myModule.key;