Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maintaining JSession

 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a web application that uses Java Applets and Servlets. The applets are actually embedded within a servlet generated jsp. I have been hosting this application with JRun using Apache and IIS, but am trying to move it to JBoss.

The problem that I am having is with reproducing an Apache/Tomcat/Jboss environment that I have found (actually for another application) which works perfectly for my application.

In the environment that I have setup, when I log on to my application (from a jsp logon page), my applet builder servlet seems to imediately loose the session. What I am observing is that the url displayed has the jsessionid added to it (which doesn't happen in my working environment) like this:

http://samcgarvey/myapp/html/index.jsp;jsessionid=6663CB32CC64EF58EB7BE71DAAE366EB.samcgarvey

Also, the internet explorer privacy report shows that IE blocked a cookie, even though I am positive that IE is setup to allow all cookies.

One difference between the two server environments (that I am awair of) is that the working environment uses JavaService to run JBoss and the other is just running JBoss using the run.bat command. I am having some difficulty setting up the JavaService and am more concerned with the jsession problem at this point. Could this be my problem?

I am running out of ideas here. Any suggestions would be greatly appreciated.

Thank you in advance,
Sean
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your MSIE settings to see if session cookies are being blocked.

Tools -> Internet Options -> Privacy (tab) -> Advanced (button).

There is a checkbox for session cookies there.
 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried checking the Allow All Session Cookies check box and I also tried setting it to Allow All Cookies (the lowest security level) and IE still tells me that it is blocking a cookie. When I access this same application from the same IE (on the same pc) through a difference server, the cookie isn't blocked, the jsessionid doesn't show up in the url and everything works properly. When I say that I am running the same application, I mean that the app.war files are identical.

If I log onto the application on the server that isn't working properly using localhost in the url, the application functions properly. Why would it work when I use access it locally using localhost and not when I access it through our LAN using the server name?
 
Sean McGarvey
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, I just noticed that when I try to access it locally (from the server) using the server name instead of localhost, IE reports that the cookie is blocked and the jsessionid shows up in the url. The servlet session is lost.

Any ideas would be greatly appreciated.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server puts the jsessionid in the url when it can't read a cookie back from the browser. Is there a firewall in the mix somewhere that's blocking cookies?

Have you tried with another browser, like FireFox?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another test you could try is to put a real simple app on your server and see if IT can set and read a session cookie.

This one is pretty simple.


If cookies are working you'll see the same sessionID every time you refresh the page. If not, you won't.

If that app works, you know the environment is good and there is an issue in your other application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic