Re: custom timeout/expiry implementation

2008-04-24 Thread mfs

Actually, i need a mean by which i can extend the session (in some cases) if
the session is about to expire. I know i can certainly do this with
Session.setMaxTimeInternal() but thats only possible with some client event
(i.e. when the servlet/filter is invoked),  which doesn't satisfy my needs.
Something like HttpSessionListener.preSessionDestroyed() is what i need..I
wonder why cant they give such control..



 

Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Farhan,
 
 mfs wrote:
 | Actually i need to provide my own session timeOut/expiry
 implementation and
 | i was wondering what would be the easiest way to achieve this, i am
 using
 | tomcat for development but oc4j for production, and i was wondering if
 | somehow i can hook in my implementation into various servlet
 containers..
 
 You could use a Filter to check whatever condition should expire
 sessions. The Filter can certainly call HttpSession.invalidate() at any
 time.
 
 Filters are (usually) cross-container because they only have access to
 standard Servlet-API stuff.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iEYEARECAAYFAkgOQ2gACgkQ9CaO5/Lv0PAAKACgwmdE9sTrDP/a1V4WdaYfVN8V
 N+cAnA+Q784oRGuFiBmHbfHNjLlt/GWS
 =bLPb
 -END PGP SIGNATURE-
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/custom-timeout-expiry-implementation-tp16825415p16851515.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



custom timeout/expiry implementation

2008-04-22 Thread mfs

Guys,

Guys

Actually i need to provide my own session timeOut/expiry implementation and
i was wondering what would be the easiest way to achieve this, i am using
tomcat for development but oc4j for production, and i was wondering if
somehow i can hook in my implementation into various servlet containers..

Thanks in advance

Farhan.
-- 
View this message in context: 
http://www.nabble.com/custom-timeout-expiry-implementation-tp16825415p16825415.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsessionId - is there a way to generate/set in the container

2008-04-17 Thread mfs

so thats not something exposed by the servlet api itself...if i understand u
correctly?, well though for my development i use tomcat/jetty servlet
containers, but our app is deployed on the oracle app server, which has its
own mini servlet engine (OSE), now given that i would need to extend the
session managers of each and provide my own, and i am getting a stomach ache
by just thinking about it.

Farhan.


markt-2 wrote:
 
 mfs wrote:
 Given the above context, i was wondering if there is some way i can
 provide
 my own unique sessionId to the servlet container whenever it creates a
 unique http session against a user.
 
 You would need to write your own manager. You should be able to extend 
 org.apache.catalina.session.StandardManager and override
 generateSessionId()
 
 See also http://tomcat.apache.org/tomcat-6.0-doc/config/manager.html
 
 Mark
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jsessionId---is-there-a-way-to-generate-set-in-the-container-tp16738580p16747531.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jsessionId - is there a way to generate/set in the container

2008-04-17 Thread mfs

Actually they don't, its a non-java based framework.

But Christoper i would still be interested in knowing the approach you took,
sounds like an interesting deal to me, now when u say wrap the servlet's
container's framework, what extended functionality did you provide in that
case in your wrapper, since the container itself provides everything as far
as session tracking is concerned, used your sessionId generation mechanism ?
or yet implemented your own mean of storing the session in the db for
example in contrast to in memory hashtable ? what was so unique about that
wrapper and how did it help inter-op..

Thanks


Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Farhan,
 
 mfs wrote:
 | Actually we have our own session tracking framework, and now
 | that i am making a seperate servlet based application, i have come to
 need
 | to support interoperability between Servlet HttpSession and the sessions
 | maintained by our session-tracking framework.
 
 Does your current session-tracking framework use HttpServletRequest
 objects to help identify the request? If so, you could re-factor your
 session framework to wrap the container's framework.
 
 I did this years ago for a company that wrote their own session
 framework. The container-managed one is really the way to go, here.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iEYEARECAAYFAkgHU4EACgkQ9CaO5/Lv0PAEdQCcCSIq8l6OTa3jPfTwJkE/5DVI
 VQsAoLvjyhc6YdksBV4NnmzPKAE6i39W
 =jKz0
 -END PGP SIGNATURE-
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jsessionId---is-there-a-way-to-generate-set-in-the-container-tp16738580p16751962.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Cookie-less session tracking - whats are the downsides

2008-04-16 Thread mfs

Guys,

I would want to know the downsides to using cookie-less sessions ? I want to
give my client the freedom to disable cookies on the browser if he chooses
to, but i would want to know the implications to that ?

Some say, exposing your sessionId in the url exposes it to hackers who can
spoof the IP (as of the victim) and provide the jsessionId (in the url) and
can gain control of the victim's session, but if u are using ssl, that
shouldnt be an issue.

Would someone comment on the real hazards/bottlenecks to the cookie-less
approach.

Thanks in advance and Regards,

Farhan.


-- 
View this message in context: 
http://www.nabble.com/Cookie-less-session-tracking---whats-are-the-downsides-tp16738472p16738472.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



jsessionId - is there a way to generate/set in the container

2008-04-16 Thread mfs

Guys,

Might not be the question for this list, but still to thought to check.

Is there a way i can provide the unique sessionID to the servlet
api/container, instead of it generating its own (whenever a new HttpSession
is created). Actually we have our own session tracking framework, and now
that i am making a seperate servlet based application, i have come to need
to support interoperability between Servlet HttpSession and the sessions
maintained by our session-tracking framework. 

Given the above context, i was wondering if there is some way i can provide
my own unique sessionId to the servlet container whenever it creates a
unique http session against a user.

Thanks in advance and Regards,

Farhan.
-- 
View this message in context: 
http://www.nabble.com/jsessionId---is-there-a-way-to-generate-set-in-the-container-tp16738580p16738580.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



When cookies are disabled by the browser ?

2008-01-25 Thread mfs

Guys,

I have got my web app deployed on the tomcat 6.0.13, I wonder what
configuration do i have to do so as to make tomcat (built-in http server)
handles the scenario where a user has disabled the cookies on the browser ?
though that wouldnt be the case for most of the users but still if that is
so i would want my application (and all session based scenarios) to function
normally..

Initially i thought that this would be all taken care of transparently and
the sessionId would become part of the url for all requests to the server
but thats not the case and my application is taking me to session-expired
page for all the links i click on..i guess thats because neither of those
links have sessionId post-fixed in it...

Please comments..

Thanks in advance


-- 
View this message in context: 
http://www.nabble.com/When-cookies-are-disabled-by-the-browser---tp15094450p15094450.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Session Replication not working ?

2007-12-03 Thread mfs

Guys,

I have setup a cluster where i have two tomcat instances (one on windows and
the other on linux), the two instances are able to detect each other and
form a cluster. On top of them i have apache/mod_jk as a load-balancer which
has sticky-sessions set to FALSE...I am trying to test this setup with a
very simple two page app, where in one jsp i am setting a string in session
and the other displaying the same..

NOW for some reasons the sessions are not getting replicated between the two
tomcat-instances, and i dont have any clue as to why would that be the
case...so if some can please assist me on this...below is my
worker.properties and the server.xml file (for the tomcat instances)..

Anything i am missing out ?


WORKER.PROPERTIES

  worker.list=worker1,worker2,lbworker
  
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=farhan-pc
  worker.worker1.port=8009
  worker.worker1.lbfactor=2
  
  worker.worker2.type=ajp13
  worker.worker2.host=eng2
  worker.worker2.port=8009
  worker.worker2.lbfactor=2

  worker.lbworker.type=lb
  worker.lbworker.sticky_session=false
  worker.lbworker.balance_workers=worker1,worker2


SERVER.XML - (the cluster section, further let me add that i have added in
the jvmRoute attribute in the engine element which matches the tomcat worker
name as in worker.properties..)
---
Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster

channelSendOptions=8

   Manager className=org.apache.catalina.ha.session.DeltaManager
expireSessionsOnShutdown=false
notifyListenersOnReplication=true/

   Channel className=org.apache.catalina.tribes.group.GroupChannel
Membership 
className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.4
   port=45564
   frequency=500
   dropTime=3000/
Receiver 
className=org.apache.catalina.tribes.transport.nio.NioReceiver
   address=auto
 port=4000
 autoBind=100
 selectorTimeout=5000
 maxThreads=6/

Sender
className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
  /Channel

   ClusterListener
className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ 
   ClusterListener
className=org.apache.catalina.ha.session.ClusterSessionListener/
/Cluster





-- 
View this message in context: 
http://www.nabble.com/Session-Replication-not-working---tf4938903.html#a14137414
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Session not being replicated - DeltaManager

2007-11-28 Thread mfs

Guys,

I have setup a cluster where i have two tomcat instances (one on windows and
the other on linux), the two instances are able to detect each other and
form a cluster. On top of them i have apache/mod_jk as a load-balancer which
has been set NOT to use sticky-sessions, since i want to test my app with a
session replication scenario...Also i tried to test this setup with a simple
two page app, where in one jsp i am setting a string in session and the
other displaying it.

NOW for some reasons the sessions are not getting replicated between the two
tomcat-instances, and i dont have any clue as to why would that be the
case...so if some can please assist me on this...below is my
worker.properties and the server.xml file (for the tomcat instances)..


WORKER.PROPERTIES

  worker.list=worker1,worker2,lbworker
  
  # Set properties for worker1 (ajp13)
  worker.worker1.type=ajp13
  worker.worker1.host=farhan-pc
  worker.worker1.port=8009
  worker.worker1.lbfactor=2
  
  worker.worker2.type=ajp13
  worker.worker2.host=eng2
  worker.worker2.port=8009
  worker.worker2.lbfactor=2

  worker.lbworker.type=lb
#worker.lbworker.sticky_session=false
  worker.lbworker.balance_workers=worker1,worker2


SERVER.XML - (the cluster section, further let me add that i have added in
the jvmRoute attribute in the engine element which matches the tomcat worker
name as in worker.properties..)
---
Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster

channelSendOptions=8

   Manager className=org.apache.catalina.ha.session.DeltaManager
expireSessionsOnShutdown=false
notifyListenersOnReplication=true/

   Channel className=org.apache.catalina.tribes.group.GroupChannel
Membership 
className=org.apache.catalina.tribes.membership.McastService
address=228.0.0.4
   port=45564
   frequency=500
   dropTime=3000/
Receiver 
className=org.apache.catalina.tribes.transport.nio.NioReceiver
   address=auto
 port=4000
 autoBind=100
 selectorTimeout=5000
 maxThreads=6/

Sender
className=org.apache.catalina.tribes.transport.ReplicationTransmitter
Transport
className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
/Sender
Interceptor
className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
Interceptor 
className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
  /Channel

   ClusterListener
className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ 
   ClusterListener
className=org.apache.catalina.ha.session.ClusterSessionListener/
/Cluster

-- 
View this message in context: 
http://www.nabble.com/Session-not-being-replicated---DeltaManager-tf4894832.html#a14018491
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session not being replicated - DeltaManager

2007-11-28 Thread mfs

Mistakenly put the wrong worker.properties in my last post where the
worker.lbworker.sticky_session=false was commented which is not the
case
Farhan.







mfs wrote:
 
 Guys,
 
 I have setup a cluster where i have two tomcat instances (one on windows
 and the other on linux), the two instances are able to detect each other
 and form a cluster. On top of them i have apache/mod_jk as a load-balancer
 which has been set NOT to use sticky-sessions, since i want to test my app
 with a session replication scenario...Also i tried to test this setup with
 a simple two page app, where in one jsp i am setting a string in session
 and the other displaying it.
 
 NOW for some reasons the sessions are not getting replicated between the
 two tomcat-instances, and i dont have any clue as to why would that be the
 case...so if some can please assist me on this...below is my
 worker.properties and the server.xml file (for the tomcat instances)..
 
 
 WORKER.PROPERTIES
 
   worker.list=worker1,worker2,lbworker
   
   # Set properties for worker1 (ajp13)
   worker.worker1.type=ajp13
   worker.worker1.host=farhan-pc
   worker.worker1.port=8009
   worker.worker1.lbfactor=2
   
   worker.worker2.type=ajp13
   worker.worker2.host=eng2
   worker.worker2.port=8009
   worker.worker2.lbfactor=2
 
   worker.lbworker.type=lb
 #worker.lbworker.sticky_session=false
   worker.lbworker.balance_workers=worker1,worker2
 
 
 SERVER.XML - (the cluster section, further let me add that i have added in
 the jvmRoute attribute in the engine element which matches the tomcat
 worker name as in worker.properties..)
 ---
 Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster  
 
 channelSendOptions=8
   
Manager className=org.apache.catalina.ha.session.DeltaManager
   expireSessionsOnShutdown=false
   notifyListenersOnReplication=true/
   
Channel className=org.apache.catalina.tribes.group.GroupChannel
   Membership
 className=org.apache.catalina.tribes.membership.McastService
   address=228.0.0.4
port=45564
frequency=500
dropTime=3000/
   Receiver
 className=org.apache.catalina.tribes.transport.nio.NioReceiver
address=auto
port=4000
autoBind=100
selectorTimeout=5000
maxThreads=6/
 
   Sender
 className=org.apache.catalina.tribes.transport.ReplicationTransmitter
   Transport
 className=org.apache.catalina.tribes.transport.nio.PooledParallelSender/
   /Sender
   Interceptor
 className=org.apache.catalina.tribes.group.interceptors.TcpFailureDetector/
   Interceptor 
 className=org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor/
   /Channel
   
ClusterListener
 className=org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener/ 
ClusterListener
 className=org.apache.catalina.ha.session.ClusterSessionListener/
 /Cluster
 
 

-- 
View this message in context: 
http://www.nabble.com/Session-not-being-replicated---DeltaManager-tf4894832.html#a14018733
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat Clustering Support - Without any load balancer like component in the front

2007-11-27 Thread mfs

Guys,

Pretty basic question, given this is my time experience on clustering where
i am trying to use tomcat 6 clustering support. 
So basically i wanted to know if enabling the tomcat 6 clustering would be
of any use without having a load-balancer in the front (something like
mod_jk) ? well my understanding so far is that we have to have some
component in the front (which tomcat i assume doesn't provide...right ?) for
either load-balancing or fail-over scenarios...

Thanks in advance and REgards,

Farhan.


-- 
View this message in context: 
http://www.nabble.com/Tomcat-Clustering-Support---Without-any-load-balancer-like-component-in-the-front-tf4885156.html#a13982315
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat Clustering Support - Without any load balancer like component in the front

2007-11-27 Thread mfs

Thanks for the quick reply Gary..

Some follow-up questions.

1) So the http server bundled with tomcat doesn't do any help ? like it
doesnt provide any load-balancing implementation ? like e.g. mod-jk which
has to be used in conjunction with apache...Further I presume mod-jk also
handles the fail-over scenarios..

2) When u say there is no huge amount of point, i wonder if there is any
point AT ALL having that tomcat clustering enabled if we dont have something
like a load-balancer/fail-over-service at the front? 

Thanks again

Farhan.





Gary Evesson-3 wrote:
 
 You need something to handle failover. Otherwise there is not a huge
 amount
 of point. Either a load balancer or mod-jk will do the job.
 
 On Nov 27, 2007 4:13 PM, mfs [EMAIL PROTECTED] wrote:
 

 Guys,

 Pretty basic question, given this is my time experience on clustering
 where
 i am trying to use tomcat 6 clustering support.
 So basically i wanted to know if enabling the tomcat 6 clustering would
 be
 of any use without having a load-balancer in the front (something like
 mod_jk) ? well my understanding so far is that we have to have some
 component in the front (which tomcat i assume doesn't provide...right ?)
 for
 either load-balancing or fail-over scenarios...

 Thanks in advance and REgards,

 Farhan.


 --
 View this message in context:
 http://www.nabble.com/Tomcat-Clustering-Support---Without-any-load-balancer-like-component-in-the-front-tf4885156.html#a13982315
 Sent from the Tomcat - User mailing list archive at Nabble.com.


 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 
 
 -- 
 Gary Evesson
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-Clustering-Support---Without-any-load-balancer-like-component-in-the-front-tf4885156.html#a13982961
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]