Is it possible to set session variables from javascript?
The short answer is no.
You can set cookies, but they are not exactly the same.
You can also use AJAX to send back to a script on your server that will set the variables. Session variables exist only on the server.
session variables are server-side scripts, so javascript, which is the client side of the script, cannot set session variables. however, you can use ajax to set the session variable asynchronously, i.e. without refreshing the page =)
yes if you use ajax call for server handler. This is probably not a safe thing. Why do you need it?
The only thing that has to do with sessions that you can change using javascript will be the session identifier, as this is what the client sees. but changing this will not have any effect on your session data that is stored on the server