Results 1 to 4 of 4
  1. #1
    geilaiam is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Unhappy receive packets and insert cookies

    Hello everybody
    I am new to java network programming and I seriously need help. I want to implement a class that receives packets on behave on another website, insert cookies in the packet or check if cookie exist, then direct the request to the website, seems weired but I realy want to get even a hint about how to do it?

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,259
    Rep Power
    25

    Default

    Read about the HTTP protocol.
    Look at the HttpURLConnection class and other classes in the java.net package.
    Also read up on Sockets.

  3. #3
    geilaiam is offline Member
    Join Date
    Jun 2011
    Posts
    2
    Rep Power
    0

    Default thanks :)

    thank you very much for your help, I did exactly what you told me to do, and I knew how to handel cookies if I have object from URLConnection (client side), but to implement a server side program, I'll need to have server socket to accept connections, I didnt find any useful info on how to read cookies from the server side (to check whether this client visted me befor or not for example).
    is there any misunderstanding? or I am seraching for somthing wrong? thanks again!

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,259
    Rep Power
    25

    Default

    Did you read about the Request Header sent by a browser to the server? That is where a Cookie would be.
    It is up to the server to define and send the cookie using a Response Header SetCookie field.

Similar Threads

  1. not able to receive packets?? pls help.
    By abdullahansari in forum New To Java
    Replies: 1
    Last Post: 06-24-2010, 02:19 AM
  2. Reading TCP Packets
    By Clive in forum Networking
    Replies: 0
    Last Post: 07-09-2009, 02:02 PM
  3. Replies: 3
    Last Post: 02-28-2009, 09:17 AM
  4. Replies: 0
    Last Post: 12-02-2008, 10:55 AM
  5. Encrypting packets
    By bugger in forum Networking
    Replies: 2
    Last Post: 02-04-2008, 10:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •