Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Servlets and Session-ID ( no cookie ... )

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Trying some examples here in 'head first servlets & jsp'.
using JEE 1.5,EL and JSTL.
I am using a form that is doPost.

Wanting to turn off the cookies and do everything myself with
the sessionid - seems difficult to me.
Trying to follow the MVC schema that my Servlet is my controller,
and that is where I should be handling my sessionid.

Using the 'HttpSession session = request.getSession(true);'
in my Servlet, reading on URL rewriting but not quite getting that.
Seems that the cookies are the default, because I get the values
that I except using cookies ...

using the following:
if ( session.isNew() ) { // Session created for the first time ...
} else {
}

then doing the 'String jSessionId= session.getId();'
should I do some rewriting here? using the response and
do some rewriting and then using the dispatcher ?



the encodeUrl is deprecated ...
I am not sure how to resend the ID to the client everytime,
seen that ofcourse on some sites and I can se that on some sites:
';jsessionid=FBD552505F99A7323F4C0E030AC3C284.node1'

is there a good example somewhere ?

regards, i
 
30 seconds to difuse a loaf of bread ... here, use this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic