JavaScript can change cookies, but it CANNOT change session variables.
Session variables are values stored on your server. The server then gives the user a cookie, so that it knows who the user is. When it recognizes a user, it looks up the values of that user's session.
The way you wrote your question was very, very confusing, but if I understood you correctly, it is not possible to directly do what you are asking.