Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

session management doubt

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone I am unable to understand the session management concept
I am providing the program and I will tell exactly where I am stuck


as far as my understanding goes :-
when the client enters his name and age in the form.html the request
goes to scwcd servlet where we get a session object then the request
is dispatched to a second jsp asking him for plot no and when the user
enters the plot number the request goes to "testservlet" servlet where
I have written a line (req.getsession()) as my second request carries the
session id it is matched and the server comes to know that this another request from the same client and when I write get attribute it gives me back the set attributes and I display it uptill this it is ok but when I disable the cookies the server should generate a new session object and getAttributes should return null but in my case I am getting the set attributes. I am confused.either there is a flaw in my understanding
or somehow I am not disabling the cookies in my IE....,

Please help to let me know where I am wrong
Thanks in advance(for showing patience!!!)
-Abhisek
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abhisek,
Cookies aren't the only way of keeping a session alive. URL Rewriting is another one (jsessionid shows up on the URL). So your session can be active without a cookie.

Also, session cookies are treated differently than persistent cookies. Check if your browser is disabling session cookies too. If not, turning off cookies isn't preventing a session.

[edited to fix typo]
[ September 20, 2008: Message edited by: Jeanne Boyarsky ]
 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thanks very much for replying but still I am facing the same problem,I am getting the values where I am expecting null values.i haven't gone for
any encoding of url and no jsession id gets appended in the address bar.
can you ive me the path where from I can clear session cookies,.I use IE as my browser

Thanks,
Abhisek
 
Jeanne Boyarsky
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Dash Abhisek:
can you ive me the path where from I can clear session cookies,.I use IE as my browser


I don't use IE so I haven't tried this. However I see something that looks relevant.

Internet Options --> Privacy Tab --> Advanced - to get the settings box
Check override automatic cookie handling to enable options
Select block first party cookies
As long as "always allow session cookies" is unchecked, I think IE would block them.
 
Ranch Hand
Posts: 47
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Abhishek,

I did try this code on my system using IE8, I was able to replicate this problem but when I restarted the server, the code produced the desired result i.e it displayed null.

As far as I know, the enabling and disabling of cookies should not be dependent on the context. Any expert comments on this please?

Thanks.
 
You can't expect to wield supreme executive power just because
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic