File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Regarding Cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Regarding Cookies" Watch "Regarding Cookies" New topic
Author

Regarding Cookies

Nagamalini Pampati
Greenhorn

Joined: Oct 04, 2006
Posts: 20
what is the result of calling getMaxAge() on "jsessionid" cookie? and is it "jsessionid" or "JSESSIONID"?

Thanks in advance,
Malini
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Logically, I would say that it returns -1, meaning that it will persist until browser shutdown.

"JSESSIONID" is the name of the cookie.
"jsessionid" is the name of the request parameter passed when using url rewriting.


[My Blog]
All roads lead to JavaRanch
Nagamalini Pampati
Greenhorn

Joined: Oct 04, 2006
Posts: 20
Thank you.
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
what is the result of calling getMaxAge() on "jsessionid" cookie? and is it "jsessionid" or "JSESSIONID"?

Thanks in advance,
Malini


JSESSIONID ( in capitals ) is the name for cookie for session management
"jsession" is the URL element that names the uniquie session ID when URL rewriting is used for session management

So , in the respose you have

and in the request you get


XXXXXXXXXXXXXXX is the session id
Hope it helps


SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Nagamalini Pampati
Greenhorn

Joined: Oct 04, 2006
Posts: 20
Thanks Niranjan.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Regarding Cookies
 
Similar Threads
access session ID from jsp and then java class
what happens if I set a response header with the name: JSESSIONID
sessionId
Who all can access HttpSession and/or its attributes ?
JSESSIONID mandatory name only in cookies not in url rewriting