• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED] Re: Session being created continuously...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED] Re: Session being created continuously...


  • Subject: Re: [SOLVED] Re: Session being created continuously...
  • From: Amedeo Mantica <email@hidden>
  • Date: Tue, 05 Apr 2011 12:34:35 +0200

Hi again,

I checked my code and I see that I was no more using that piece of code, and I actually don't recall why

actally in that app there is just a short session expiring time for robots.

But I'll put hands again with this code to check and fix.
Regards
Amedeo

On 02/apr/2011, at 22.55, Mike Schrag wrote:

session = store.checkOutSessionWithID(sessionIDForRobots, worequest );
if( session == null) {
session = super.createSessionForRequest(worequest);

seems like a race condition here if you have concurrent request handling enabled ... you should synchronize everything inside the "robot" condition on some "robot" object

On Apr 2, 2011, at 4:38 PM, Amedeo Mantica wrote:

I have to check, I'll let you know

On 01/apr/2011, at 19.29, Benjamin Chew wrote:

Hi Amedeo,

I just tried implementing this on my website a couple of days ago. I think it works, but JavaMonitor seems to be showing a much higher session count than before. Did you notice that too?

Ben


On Fri, Jan 29, 2010 at 9:03 AM, Amedeo Mantica <email@hidden> wrote:
ok, last one, i don't spam more :)

protected String sessionIDForRobots;

@Override
public WOSession createSessionForRequest(WORequest worequest) {
String userAgent = worequest.headerForKey("user-agent");
WOSession session;
if ( userAgent.contains( "robot" )) {
WOSessionStore store = super.sessionStore();
session = store.checkOutSessionWithID(sessionIDForRobots, worequest );
if( session == null) {
session = super.createSessionForRequest(worequest);
session.setStoresIDsInCookies(true);
session.setStoresIDsInURLs(false);
sessionIDForRobots = session.sessionID();
}
} else {
session = super.createSessionForRequest(worequest);
}
return session;
}

On 29/gen/2010, at 16.47, Amedeo Mantica wrote:

there was a bug preventing creation of new robots session when the first expires

here correct code

protected String sessionIDForRobots;

@Override
public WOSession createSessionForRequest(WORequest worequest) {
String userAgent = worequest.headerForKey("user-agent");
WOSession session;
if ( userAgent.contains( "robot" )) {
if ( sessionIDForRobots==null || sessionIDForRobots.equals("") ) {
session = super.createSessionForRequest(worequest);
sessionIDForRobots = session.sessionID();
} else {
WOSessionStore store = super.sessionStore();
session = store.checkOutSessionWithID(sessionIDForRobots, worequest );
if( session == null) {
session = super.createSessionForRequest(worequest);
sessionIDForRobots = session.sessionID();
}
}
} else {
session = super.createSessionForRequest(worequest);
}
return session;
}



On 29/gen/2010, at 16.30, Amedeo Mantica wrote:

Following your suggestion i have made this, that seem to work fine

why not embed it in wonder ? ( enabled by a property )


in my Application:

protected String sessionIDForRobots;

@Override
public WOSession createSessionForRequest(WORequest worequest) {
String userAgent = worequest.headerForKey("user-agent");
WOSession session;
if ( userAgent.contains( "robot" )) {
if ( sessionIDForRobots==null || sessionIDForRobots.equals("") ) {
session = super.createSessionForRequest(worequest);
sessionIDForRobots = session.sessionID();
} else {
session = super.restoreSessionWithID(sessionIDForRobots, worequest.context());
}
} else {
session = super.createSessionForRequest(worequest);
}
return session;
}


Regards
Amedeo



On 29/gen/2010, at 11.37, Amedeo Mantica wrote:

oh, i didn't knew that command, useful, thanks
Amedeo

On 29/gen/2010, at 00.29, Anjo Krank wrote:

A session isn't all that much. It mostly contains an EC, some pointers and the (limited) stack of pages.

It's only when you have a bunch of EOs in the session EC that they get heavy.

Try it: make an empty app, override Session() to include a counter, use "ab" with ab -c 5 -n 5000000 and check when you get an OOM.

Cheers, Anjo



Am 28.01.2010 um 23:46 schrieb Amedeo Mantica:

I agree with you, but is not easy to avoid
Amedeo

On 28/gen/2010, at 23.23, Miguel Arroz wrote:

Hi!

BTW, just an advice: it may be a good idea to not create a session every time someone opens your app front page. This can be a hole to a very simple DoS.

Yours

Miguel Arroz

On 2010/01/28, at 20:37, Amedeo Mantica wrote:

btw, thank you all for the support

On 28/gen/2010, at 21.30, Amedeo Mantica wrote:

Comparing these timestamps with apache logs seems that ip addresses are of google bots

now i don't know why my woapp see the self server ip address.

Amedeo


Jan 28 21:07:31 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 21:07:43 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - .
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Session Invoked. ID = snScYHezfXZ2YCIq4vZVt0
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser platform = Unknown Platform
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser user info = {cpu = "Unknown CPU"; geckoRevision = "No Gecko"; }
Jan 28 21:07:43 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 21:07:53 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - .
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Session Invoked. ID = qrsn4ipZzHYH7lZF2JXgyw
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser platform = Unknown Platform
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser user info = {cpu = "Unknown CPU"; geckoRevision = "No Gecko"; }
Jan 28 21:07:53 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 21:07:55 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - .
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Session Invoked. ID = 9BRZmo11a3Z70bzbALCFyg
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser platform = Unknown Platform
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser user info = {cpu = "Unknown CPU"; geckoRevision = "No Gecko"; }
Jan 28 21:07:55 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 21:08:06 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 21:08:06 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - .
Jan 28 21:08:06 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Session Invoked. ID = SO1NEan3slUhY8s7RX0BLM
Jan 28 21:08:06 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 21:08:06 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser platform = Unknown Platform
Jan 28 21:08:06 confindustria[2013] DEBUG er.extensions.appserver.ERXSession  - Browser user info = {cpu = "Unknown CPU"; geckoRevision = "No Gecko"; }


On 28/gen/2010, at 20.58, David Avendasora wrote:

Spotlight?

On Jan 28, 2010, at 2:42 PM, Amedeo Mantica wrote:

I think too, but xx.xx.xx.xx is my server ip address !!

On 28/gen/2010, at 20.37, Chuck Hill wrote:

Jan 28 19:47:12 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot

I'd guess that something is indexing your site.

Chuck


On Jan 28, 2010, at 11:35 AM, Amedeo Mantica wrote:

Jan 28 19:47:03 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:12 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:12 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:12 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:20 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:20 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:20 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:27 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:27 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:27 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:33 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:33 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:33 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:39 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:39 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:39 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:47:51 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:47:51 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:47:51 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:48:03 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:48:03 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:48:03 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:48:15 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:48:15 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:48:15 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:48:26 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:48:26 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot
Jan 28 19:48:26 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Remote IP Address = xx.xx.xx.xx
Jan 28 19:48:38 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - New Session
Jan 28 19:48:38 confindustria[2013] INFO  er.extensions.appserver.ERXSession  - Browser = robot


NOTE xx.xx.xx.xx is alway the same ip address and is the my webserver ip !!

What's up?

Thanks
Amedeo _______________________________________________
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

--
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific 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:

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


_______________________________________________
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



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)

This email sent to email@hidden



_______________________________________________
Do not post admin requests to the list. They will be ignored.

This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.

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

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
References: 
 >Re: [SOLVED] Re: Session being created continuously... (From: Benjamin Chew <email@hidden>)
 >Re: [SOLVED] Re: Session being created continuously... (From: Amedeo Mantica <email@hidden>)
 >Re: [SOLVED] Re: Session being created continuously... (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: Excel download question
  • Next by Date: Trouble with form
  • Previous by thread: Re: [SOLVED] Re: Session being created continuously...
  • Next by thread: Help with ERAttachments
  • Index(es):
    • Date
    • Thread