I have a database that stores events in it and a page with a calendar object on it. When rendering the days it looks through the months events and if any match the current d
Your session vars are controlled by the server, JS runs client side, and as such cannot modify the vars directly.
You need to make server requests using POST or GET and hidden iframes, or XMLHTTPRequest() calls to send data from the JS to the server, and then have your server side code handle the vars.
Add another query string variable that the page can use to trigger existing vs new.