🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages Started by Peter Th�nell Mon, 27 Oct 2003 08:18
Cookies on client
#387
Author: Peter Th�nell
Date: Mon, 27 Oct 2003 08:18
4 lines
1023 bytes
How do I (using URLConnection etc.) obtain and send cookies?

Also, how does one distinguish between session and persistent cookies?
Re: Cookies on client
#390
Author: Paul Furbacher TeamB
Date: Tue, 28 Oct 2003 22:29
44 lines
2361 bytes
In <3f9cd4b8@newsgroups.borland.com> Peter Th?nell wrote:
>  
>  How do I (using URLConnection etc.) obtain and send cookies?
>  
>  Also, how does one distinguish between session and persistent cookies?

A Google search of

  URLConnection cookies

yields a number of hits.  Here's just one:

  http://www.hccp.org/java-net-cookie-how-to.html

Assuming you are talking about communicating
between a client application and a Web server, 
here are some thoughts:

Since there's no definition of what a session is
with a URLConnection approach to communicating 
with a server, you'll have to determine what's
a session and when a cookie is invalid.  Both
sides of your application (client and server side)
will have to have logic to handle this.

The Cookie class has get/setMaxAge() which can be 
used to set and determine whether the cookie is
expired.  Your client app will have to ask "getMaxAge()"
and decide when to dispose of it.  You could follow
the convention that 0 (zero) mean expire now, -1
means expire when the client exits, and so on.


Paul Furbacher [TeamB]

  Save time, search the archives:
       http://info.borland.com/newsgroups/ngsearch.html
       
  Is it in Joi Ellis's Faq-O-Matic? 
       http://www.visi.com/~gyles19/fom-serve/cache/1.html
 
  Finally, please send responses to the newsgroup only.
  That means, do not send email directly to me.
  Thank you.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads