Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
    Bookmark Topic Watch Topic
  • New Topic

why new URLConnection in java application can't keep session

 
chen juxing
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
My java-application client work this way:
first request for book list, then request for infomation of a special book by index. But I find the second request can't store the cookie from first session.
Here is my relative code:
URL url = new URL(URLAdresse);
URLConnection urlConnection = url.Connection();
if (!cookie.equals("")){
urlConnection.setRequestProperty("cookie", cookie);
}
urlConnection.connect();
kindly tell me why, thks!
[ February 20, 2003: Message edited by: chen juxing ]
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Originally you started to ask this question in this very old thread... http://www.coderanch.com/t/347115/Servlets/java/session

I've closed that one, everyone please continue the conversation in this one.
 
    Bookmark Topic Watch Topic
  • New Topic