This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes whilst fooling around with SessionId and cookies... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "whilst fooling around with SessionId and cookies..." Watch "whilst fooling around with SessionId and cookies..." New topic
Author

whilst fooling around with SessionId and cookies...

achana chan
Ranch Hand

Joined: Jul 29, 2002
Posts: 277
I often use a little java program to (re)familiarize myself with header and session data. Whilst playing around I noticed that when I hit a page for the first time with

it retrieves and displays the session ID whereas the following methods return nulls the first time around

Only on refreshing or "hitting the page again" do they get "synchronized", of that's the right word.
(Q1) Are these the same thing: sessionId, JESSSIONID, cookies ? They display the same values.
(Q2) What is the method "request.getSession(true)" used for ? The arbitrarily assigned hex-value surely cannot identify the session uniquely ?
Here is the code, you need only modify the package, starting from your docbase.


One day, I too will be a java programmer, just not today!


humanum errare est.
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
I'm moving this to Servlets.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: whilst fooling around with SessionId and cookies...
 
Similar Threads
Session Management
Servlet becomming slow
Not able to set cookies
Testing Cookies
SESSION TRACKING.