Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can we read browser saved cookies from a java desktop application?

I want to transfer web login session to my java desktop application ,so that once again I don't want to login in my desktop application.

Once the user logs into my web application, I set some cookies on the user system, once he starts my standalone application I would like to use the credentials stored here to log my user into the application without asking to re-login.

My questions: - Can I access the cookies to read Auth token and other params? Is this the proper solution? - To achieve the above requirement , is there any proper solution.

Cookie seemed like a solution for me here. But in essence I want a seamless integration between the web application and the standalone application. What kind of solutions are available for this?

like image 635
Handroid Avatar asked Dec 15 '15 14:12

Handroid


People also ask

Do desktop apps have cookies?

Cookies do exist on the mobile web just as they do on the desktop. Users who browse the Internet using mobile web browsers get cookies placed on their browsers. Every mobile browser, just like desktop browsers, has different cookie settings and handle first party and third party cookies differently.

Where cookies are used in Java?

A Cookie is small information sent by a web server to a web client. Cookies are saved at the client side for the given domain and path. The cookie file persists on the client machine and the client browser returns the cookies to the original.

What are cookies and session How can you use them in Java?

Simply put, a cookie is a small piece of data stored on the client-side which servers use when communicating with clients. They're used to identify a client when sending a subsequent request. They can also be used for passing some data from one servlet to another. For more details, please refer to this article.


1 Answers

For the above requirement we need to use Java Web Start technology Here is the link http://docs.oracle.com/javase/tutorial/deployment/webstart/

like image 126
Handroid Avatar answered Oct 01 '22 02:10

Handroid