jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes Session Tracking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Session Tracking" Watch "Session Tracking" New topic
Author

Session Tracking

wesley alfred
Greenhorn

Joined: Oct 06, 2003
Posts: 4
Hi pals,
I am storing the user name in the session id, which i created by http session getSession(), i am calling a jsp page from servlet which carry the username and pops in the screen,
Its working fine in Iexplore 5.o but not in IE 6.0, it returns null,
pl quide me to proceed
thnks in advance
wesley
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,
I believe it has to work in both IE versions. Can you please your code.
Regards,
M.S.Raman
wesley alfred
Greenhorn

Joined: Oct 06, 2003
Posts: 4
Hi M.S.Raman,
Let me explain my position in detail,
1. in a JSP page i am getting the username and password,
2. through java script i am directing to a particular servlet.
3.In the servlet i am validating the username and password if it is valid i am redirecting to a html page which contains a jsp page.
4. in that jsp page i am welcoming the user by his name.
5. for the full scenario i am validating the session by httpsession.
This think work fine in the browser ie5.0, but while retriving in ie6.0 it return null.
(i.e) actually i am storing the user name in the session variable.
so in the final jsp page the session variable does't hold the username rather null in ie6.0
wesley
Ayman Nour El Din
Greenhorn

Joined: Oct 07, 2003
Posts: 1
apparently your session id is not passed to the new jsp and a new session is created that contains of course nothing at all.
make sure you use this
response.encodeRedirectURL(url)
it appends the session id to the end of the url string , you may then use the whole url string in the redirection.
hope it works.
good luck
Malhar Barai
Author
Ranch Hand

Joined: Aug 17, 2001
Posts: 399
hello,
is your javascript & other things related to java working in IE6..!!??
hth
MB
randeep singh
Greenhorn

Joined: Sep 23, 2003
Posts: 4
u need to check if cookies are disabled in IE6.0 if so enable them
then there in no need to encode URL
randeep
wesley alfred
Greenhorn

Joined: Oct 06, 2003
Posts: 4
Hi randeep,
Thnks when i enable the cookie in the browser ie6.0 my problem got solved i am getting the session variable displayed in my browser,
thnks Malli, Ayman, Malhar for your suggession.
well can i do something in my code to enable the cookie if the request particularly comes from ie6.0 before processing.
wesley
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Originally posted by wesley alfred:
Hi randeep,
Thnks when i enable the cookie in the browser ie6.0 my problem got solved i am getting the session variable displayed in my browser,
thnks Malli, Ayman, Malhar for your suggession.
well can i do something in my code to enable the cookie if the request particularly comes from ie6.0 before processing.
wesley

Hi Wesley,

Logically it is not possible. Because in the IE Cookies enable/disable feature is provided to the user to secure their systems. In this case you have to use URLRewriting methods for the session tracking.
Regards,
M.S.Raman
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session Tracking