Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet-encodeURL and Jsp-session gives different Session ID!

 
Ajay Chandravadiya
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I encoded URL of JspA in ServletA, showed that link to user[thru <a href> ] and clicked on that link with cookies Disabled.Then I can see that the URL in address bar of browser shows Different Session ID and when I print session id thru <%=session.getId()%> in JspA, I am seeing a different ID! How is that possible?

Here is the snippet of code...

ServletA

JspA
[ October 20, 2007: Message edited by: Ajay Chandravadiya ]
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you print the session ID from inside the Servlet, does it match the SessionID that is sent back to the browser and can be seen when you the view source? This is the source of the page that allows you to click the link and go to the JSP.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!