Re: When a session is created?
Re: When a session is created?
- Subject: Re: When a session is created?
- From: Mike Schrag <email@hidden>
- Date: Tue, 21 Jun 2005 13:42:24 -0400
If this is Safari, you can see for sure what the browser is
requesting by opening Activity Window (option-cmd-a) and you can see
the full request url for every element on the page. Firefox has an
equivalent feature in it as well, but I don't remember where it's
hidden.
ms
On Jun 21, 2005, at 12:34 PM, Chuck Hill wrote:
It might be a browser bug. It looks like the browser is
interpreting src="/qamino/backoffice/swf/check.swf... as
src="qamino/backoffice/swf/check.swf (note lack of leading /. You
could try fully qualifying it: src="http:.//www.domain,com/qamino/
backoffice/swf/check.swf...
Otherwise, I'd try to catch it at the web server (Apache?) and use
a rewrite rule to guide it to the correct place.
Chuck
On Jun 21, 2005, at 4:24 AM, Sébastien Gruhier wrote:
Thanks guys for the advice now I know what creates a new session,
it's a flash component in the page but why!!
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
id="menu" codebase="http://fpdownload.macromedia.com/pub/shockwave/
cabs/flash/swflash.cab#version=7,0,0,0" align="center" width="17"
height="17">
<PARAM NAME="allowScriptAccess" VALUE="sameDomain">
<param name="movie" value="/qamino/backoffice/swf/check.swf?
id=1854472855&state=on"></param>
<PARAM NAME="quality" VALUE="high"/>
<param name="bgcolor" value="#F3F3F3"></param>
<embed pluginpage="http://www.macromedia.com/go/
getflashplayer" allowScriptAccess="sameDomain" type="application/x-
shockwave-flash" quality="high" src="/qamino/backoffice/swf/
check.swf?id=1854472855&state=on" align="center" width="17"
height="17" bgColor="#F3F3F3"></embed>
</object>
So when I trace the uri() in the dispatchRequest, the new session
comes from : /qamino/backoffice/swf/check.swf?
id=-1183135035&state=on
How can I avoid this new session?
May I just test something like that and retrun null?
public WOResponse dispatchRequest(WORequest request) {
if (request.uri().indexOf(".swf") >0)
return null;
else
return super.dispatchRequest(request);
}
Thanks
Le 20 juin 05 à 19:07, Chuck Hill a écrit :
In addition to Mark's excellent advice, check any JavaScript you
are using. If a link is submitting the form, ensure that the
script is returning false. Another good debugging technique for
this is to override dispatchRequest in Application and log out
request().uri(). This, combined with the session logging below,
will show were in the page the errant request is coming from.
Chuck
On Jun 20, 2005, at 5:53 AM, Mark Ritchie wrote:
On 20-Jun-05, at 2:59 AM, Sébastien Gruhier wrote:
I would like to know when a session is supposed to be created
because I have noticed that a new session is created on each
submit of a form.
Hi Sébastien,
If this problem happens every time then I would use the debugger
and set a break point on session creation to see what's happening.
When that's not the case, when it happens intermittently then I
sometimes resort to something like this. I override the session
constructor and log when the session is created, it's sessionId
and the stackTrace so I can see exactly how the session is being
created. This has been very enlightening over the years. I
hope it helps:
public Session() {
super();
String message = "Session created (sessionID:" +
sessionID() + ")";
NSLog.err.appendln(message);
new Exception(message).printStackTrace();
}
When a session is created in response to a component action, the
output will look something like this:
[2005-06-20 08:25:00 EDT] <WorkerThread0> Session created
(sessionID:AVSmK1ZBBYLDgt2uI3GbYw)
java.lang.Exception: Session created
(sessionID:AVSmK1ZBBYLDgt2uI3GbYw)
at Session.<init>(Session.java:18)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0
(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance
(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at com.webobjects.foundation._NSUtilities.instantiateObject
(_NSUtilities.java:577)
at
com.webobjects.appserver.WOApplication.createSessionForRequest
(WOApplication.java:1611)
at
com.webobjects.appserver.WOApplication._initializeSessionInContext(
WOApplication.java:1752)
at
com.webobjects.appserver._private.WOComponentRequestHandler._dispat
chWithPreparedApplication(WOComponentRequestHandler.java:309)
at
com.webobjects.appserver._private.WOComponentRequestHandler._handle
Request(WOComponentRequestHandler.java:358)
at
com.webobjects.appserver._private.WOComponentRequestHandler.handleR
equest(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchRequest
(WOApplication.java:1306)
at com.webobjects.appserver._private.WOWorkerThread.runOnce
(WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run
(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:552)
Good Luck!
Mark.
__
Mark Ritchie
Diamond Lake Consulting Inc.
Toronto, Ontario, Canada
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects
developers who want to increase their overall knowledge of
WebObjects, or those who are trying to solve specific application
development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Practical WebObjects - a book for intermediate WebObjects
developers who want to increase their overall knowledge of
WebObjects, or those who are trying to solve specific application
development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mdimension.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden