File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes session management using cookies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "session management using cookies" Watch "session management using cookies" New topic

session management using cookies

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Hi All,

I came across to this question during one of the interviews.

How do we manage a session with cookies in servlet, if suppose we dont want to use a cookie class? is it possible?


smitha verghese
Ranch Hand

Joined: Jun 21, 2003
Posts: 42
Hi there r diff ways to maintain sessions

1. hidden fields
2. url appending
3. Session objects
4. Cookies

Grishma Dube
Ranch Hand

Joined: Jul 01, 2003
Posts: 275
Thanks Smitha, but i know the ways of tracking a session.

Pls read my question carefully. I said, how do i manage a session using cookies but without making use of Cookie class?

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Lets have a little more detail - what do you mean by "manage a session"??
I'm assuming you have read the HttpSession JavaDocs - what do you want to do that is not covered there? Have you read the JavaDocs for the various session listeners?
Rovas Kram
Ranch Hand

Joined: Aug 08, 2003
Posts: 135
Maybe the interviewer is looking for:

Use HttpServletRequest.getHeader(String) which can be used to get the cookies as a String instead of HttpServletRequest.get Cookies() whichs returns an array of Cookie class.
I agree. Here's the link:
subject: session management using cookies
It's not a secret anymore!