0

I want to create a session using a client side jQuery API in Java.

Is it possible to create such a session in jQuery in Java EE, i.e. via JSP and Servlet?

3 Answers 3

1

You can create cookie in jQuery cookie plugin(can do in pure JavaScript as well). you can read the cookie using the server side. then you can create the session in the server side.

Sign up to request clarification or add additional context in comments.

1 Comment

jQuery cookie plugin is very useful. I have used but also a problem stackoverflow.com/questions/10765172/…
0

Any request you make to a JSP/Servlet from the client (with/without jquery) will result in a session (if one doesn't exists already).

Comments

0

I'm guessing that you don't just want to create the session, you want to store some values in it as well. If this is the case, your best bet is to make an AJAX call to a Servlet that will take the values from the request and put them in the session. jQuery can manipulate cookies, but can't manipulate session data directly.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.