• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

session management using cookies

 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

TAI

Grishma
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there r diff ways to maintain sessions

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

smitha
 
Grishma Dube
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

Grishma
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
Bill
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic