Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Creation

 
Chandar Vel
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All
I tried creating the a session at home where i have jswdk(web server), it creates only one session for different browser instance (all the browser instance are the same, either IE or netscape). At work we have weblogic server and it creates different session for each browser instance. If i create a browser instance thro'
file->new it creates only one session for different browse
instance.Here is the code i tested in the jsp
HttpSession x = request.getSession(false);
if (x.isNew())
System.out.println("new session");
else
System.out.println("Old session");
Can any one pl explain this.
Thanks for your help
Chandar
 
Nitin Shivaram
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You have to call getSession(true) to get a new session if there is no session, or return an existing session.
If u call with "false", it returns you null if there is no session object.
Please check the API for more details.
cheerio
------------------
Nitin S
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic