Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to knw if client rejects Cookies ?

 
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
 
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?
 
New rule: no elephants at the chess tournament. Tiny ads are still okay.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic