• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to knw if client rejects Cookies ?

 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
How can we get to knw for sure dat client rejects cookies

Well , client might rejects cookies if :
- getSession(false) returns null , dat means no HttpSession object has been created , so client might be rejecting cookies .
- isNew() always returns true

I knw , session-tracking is web-container dependent , and it might use url-rewriting if client reject cookies .
But our servlet can always explicitly use cookies . So is any sure way to knw if client reject cookies ?
Wot i think is :

  • Make a cookie and send it to client
  • Make client call da same servlet again
  • check if same cookie comes wid this request or not

  • is it right way ? any other idea?

    ------------------
    Gagan (/^_^\) SCJP2
    Die-hard JavaMonk -- little Java a day , keeps u going .
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anyone ? any views plz
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this would work, but what about calling request.isRequestedSessionIdFromCookie() and request.isRequestedSessionIdFromURL() for determining whether client is using cookies or URL for session info?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic