• Post Reply Bookmark Topic Watch Topic
  • New Topic

Netscape Browser and session  RSS feed

 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I posted this earlier and reposted just in case anyone might have some input. Thanks!

Hi all!
First I'd like to thank everyone who has helped me in the past through this site. It is a great resource for a new programmer like myself.
Question: when I first try to log into the web app I wrote, Netscape 4.76 initially takes a long time to set the session variable internally. It takes as long as 2 minutes. The exact same code accessed from IE 5 and above works just fine. Anyone ever heard of that before? It also works perfectly fine on Netscape 6.
It seems to be a browser problem. Any thoughts would be appreciated.
Thanks,
Ronald Whalen
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only related thing I can think of is: have you ever deleted cookies manually?
I did this in Netscape once and it complained mightily. There was something 'extra' it does in cookie management that I also messed up...
Dave
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
I have never done that before. Nescape 4.7 just seems to hang. I did narrow it down to when the servlet creates the session variable for the first time. I have searched quite exhaustively for an answer and just can't seem to find one.
Ronald Whalen
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried testing your webapp on a completely different machine?

Or if that's not practical, completely remove and re-install NS4.7 ?

It seems to be a browser issue, so I'd be highly suspect of that particular installation of the browser.
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply..
It has been tried on two other machines. Mine runs Win2k. The others are an older NT version and a Unix box.
All are 4.7x. I also tried it on 4.08 and it took 2 minutes 45 seconds. I am 99% sure that it must be a browser issue.In my research I have not come across any issue that even remotely resembles this.
Ronald Whalen
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, you said you tracked it down in your servlet. Are you allowed to post the relevent code here? This does seem very odd, and a worthy challenge for the smart cookies amongst us.

hehe.. no pun intended about netscape cookies being dumb.
[ January 09, 2002: Message edited by: Mike Curwen ]
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the relevant code:
If it might make a difference I am using Tomcat 3.2.1. Additionally I am using a Connection Pool. I just noticed that there is a delay, while brief, sometimes creating new connections. When using IE this has never been an issue
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
System.out.println("processRequest() entry: ");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
System.out.println("Right before setting session....");

HttpSession session=request.getSession(true);
session.setMaxInactiveInterval(3600);

System.out.println("Right after setting session´┐Ż.");

int userID;
String userName="";

if(request.getParameter("param1")!= null){
try{
//function call
}catch(Exception e){}
}
if(request.getParameter("param2")!= null){
try{
//function call
}catch(Exception e){}
}
}//end function

Thanks for taking a look.

Ronald Whalen
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was hoping for something obvious in your code. Something like But no such luck.

So when you hit this servlet for the very first time with Netscape browsers (pre 6), the delay between seeing "Right before setting session...." and "Right after setting session...." is up to two minutes?

This is really strange. I've asked around my office and no one has heard of it before.

As a last resort, have you tried using Tomcat 3.2.4 (the latest version of the 3.2.x line), or even Tomcat 3.3 ?

Tomcat 4.x is quite a different beast, and supports a different spec.

The connection pool you mention, is that a db connection pool? If so, it probably has nothing to do with this problem. If it's a web connection pool, then perhaps this is causing a problem with the getSession() method. Are you able to remove this pool and try again?
[ January 10, 2002: Message edited by: Mike Curwen ]
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are correct about what happens: the right before getting session executes, then a 2 minute delay, then after getting session executes.
The connection pool I am using is a db connection pool. I will look into newer versions of Tomcat as you suggested. I wanted this to be a last resort, but I guess it has come to that.

Thanks for all your help.
Ronald Whalen.
P.S. If I find a solution, I will post it.
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just tried it using Tomcat 3.3 and got the same result. At least the db connections are created with no hesitation at all.

Ronald Whalen
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Further clarification:

When you say "the first time I get the session", what exactly does this mean.

For example: Is it only taking a long time the very first time getSession() is called for the very first unique user to the webapp, or the first time for *every* unique user.

The difference being: Does getSession() only take a long time, the very first time it is EVER called by ANYONE after Tomcat restarts, or is it the very first time for each new user?
 
Ronald Whalen
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem occurs when Tomcat is started for the first time. I have a logout function which simply invalidates the session. If the same user or another tries to login again, without shutting down Tomcat, it seems to work fine. So I guess the first time Tomcat starts up and the first user who tries to create a session has difficulty.
By "get session" I mean create an instance of a session variable.
Thanks,
Ronald Whalen
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from the Tomcat-Users email group. I replied to a closely related topic, and perhaps this will fix the problem, although I don't see why (ie: your problem appears to be CLIENT related, and not server), but it's worth a try.

I believe the problem has to do with the initialization of the random
number generation used for generating session id's. That's why it only
happens on the first request.
To get around this you can force the initialization in a startup
servlet. Try something like this:
new java.security.SecureRandom().nextLong();
Hope this helps.
Mike Curwen wrote:
>Hi,
>
>This is a closely related question, so thought I'd use this thread.
>
>I'm the co-moderator of a Java Servlets forum, and a question came up
>recently that I have never heard of before. It seems a user has found that
>request.getSession() takes a very long time to return if he is using
>Netscape browser version 4.x, as opposed to using IE. It has baffled me so
>far, has anyone ever run across this situation? ps: we're talking minutes,
>not just 5 seconds.
>
>http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=7&t=0071
>39
>
>There is the link, and I thank anyone for contributing either on this
>mailing list, or in the forum.
>
>>From: "Katsuyuki Michishita" <kmichishita@imobile.co.jp>
>>To: <tomcat-user@jakarta.apache.org>
>>Sent: Friday, January 11, 2002 12:00 PM
>>Subject: getSession take too mush time.
>>
>>
>>>request.getSession() take 5 second to execute the code.
>>>one of person answer me following:
>>>"is it tomcat? then it's because sessionids are computed by
>>>
>SecureRandom.
>
>>>First
>>>number takes about 5 seconds, thats normal"
>>>
>>>So this is happen only first time of execution?
>>>I do not have to worry this a day later?
>>>
>>>thank you
>>>
>>>-Kats
>>>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!