Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tell me what is wrong in this?  RSS feed

 
archana vishwanath
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!
Topic :Session Tracking
_______________________
What I did?
____________
session.setAttribute("userid",userid);
session.getAttribute("userid");
ALl of you know this is the way of tracking session and this will work in all browsers,and unlike cookies no body can disable session also.
Then where does cookies comes into picture and what is wrong if I track
the users in my site using the method,I have desribed earlier.Is it the
right thing I'm doing to track the users.
Please advise me on this,
Thanks for all!
 
Sanju Thakur
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The method that you have adopted is correct.
Session internally uses Cookies or URL rewriting. If cookies is disabled, it will use URL rewriting. You have to be aware of one thing though, if the server has resorted to URL rewriting, then you should do a response.encodeURL(String) for all the links/urls you will have on your view (jsp).
Hope that helps.
Regards,
Sanju
 
sajjad ahmad
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!
yeah using session is a good idea to track the users in ur site but it sometimes lead to complexities when ur site gets more complex in future.
u have to realy keep the track of the values u are going to store in session and evrytime a user is loged off then u should explicitly remove all values from the session..
yeah u can also use session.invalidate() method to do this...
but there are few cases (i have already faced those situations)when u don't want to completly remove the session...
in those cases if u r not handling sessions with care it may lead to many problems......
hope it helps u and u will care now...
best wishes
Sajjad Ahmed
 
archana vishwanath
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys,
But what will be the "some" problems in the method I have adopted.
and if Im going for cookies and the client disables cookies in his browser,
How to overcome this?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!