expire session manually

80 views
Skip to first unread message

helpdesk....@gmail.com

unread,
Dec 14, 2012, 4:03:45 AM12/14/12
to memcached-se...@googlegroups.com
Hi,

Our website admins would like to be able to expire someone's session immediately. What is the suggested way doing this in a multi-server environment using non-sticky sessions?

Thanks.


Martin Grotzke

unread,
Dec 14, 2012, 4:49:13 AM12/14/12
to memcached-se...@googlegroups.com
Is this a one-time action or is this a recurring use case?

For 1) I'd suggest to manually delete items related to the session from
memcached, for 2) this could be built into msm e.g. in combination with
a jmx interface (that could be exposed via some more user friendly ui if
necessary).

Cheers,
Martin
signature.asc

helpdesk....@gmail.com

unread,
Dec 14, 2012, 5:32:15 AM12/14/12
to memcached-se...@googlegroups.com, martin....@googlemail.com

This is a recurring case, I am trying to figure which way would be better for us.

1) Would it be ok if we deleted the session object from memcached by using the session-manager generated key?
2) Would you please give us some directions for how to add this logic into msm?

Thanks again.


14 Aralık 2012 Cuma 11:49:13 UTC+2 tarihinde Martin Grotzke yazdı:

Martin Grotzke

unread,
Dec 14, 2012, 6:03:30 AM12/14/12
to memcached-session-manager
On 12/14/2012 11:32 AM, helpdesk....@gmail.com wrote:
>
> This is a recurring case, I am trying to figure which way would be
> better for us.
>
> 1) Would it be ok if we deleted the session object from memcached by
> using the session-manager generated key?
You have to remove all items from memcacheds that are related to the
session. Run memcached with -vv to see which keys are stored for a
session (on primary node and backup node, which is the "next" from the
node ring) to find out how keys are generated (e.g. some with "bak:" and
"validity:" prefixes). Sorry I don't have the time to find out exact
details for you right now.

> 2) Would you please give us some directions for how to add this logic
> into msm?
Check out MemcachedBackupSessionManager (in tc6/tc7 modules), there are
remove methods for a Session. There you would add some method to
invalidate a session by id. The method might already exposed via jmx
automatically, just check this.

Implement your changes in a github branch so that I can review/support.

Cheers,
Martin


>
> Thanks again.
>
>
> 14 Aralık 2012 Cuma 11:49:13 UTC+2 tarihinde Martin Grotzke yazdı:
>
> Is this a one-time action or is this a recurring use case?
>
> For 1) I'd suggest to manually delete items related to the session from
> memcached, for 2) this could be built into msm e.g. in combination with
> a jmx interface (that could be exposed via some more user friendly
> ui if
> necessary).
>
> Cheers,
> Martin
>
>
> On 12/14/2012 10:03 AM, helpdesk....@gmail.com <javascript:> wrote:
> > Hi,
> >
> > Our website admins would like to be able to expire someone's session
> > immediately. What is the suggested way doing this in a multi-server
> > environment using non-sticky sessions?
> >
> > Thanks.
> >
> >
>

--
inoio gmbh - http://inoio.de
Breitenfelder Str. 13c, 20251 Hamburg
Amtsgericht Hamburg, HRB 123031
Geschäftsführer: Dennis Brakhane, Martin Grotzke, Ole Langbehn

signature.asc

helpdesk....@gmail.com

unread,
Dec 21, 2012, 8:37:26 AM12/21/12
to memcached-se...@googlegroups.com, martin....@googlemail.com

Hello,

Needed methods have already been exposed through jmx. We decided on using them. Thanks for the direction.

Take care.


14 Aralık 2012 Cuma 13:03:30 UTC+2 tarihinde Martin Grotzke yazdı:

Martin Grotzke

unread,
Dec 21, 2012, 9:39:14 AM12/21/12
to memcached-se...@googlegroups.com
Great!

Cheers,
Martin


On 12/21/2012 02:37 PM, helpdesk....@gmail.com wrote:
>
> Hello,
>
> Needed methods have already been exposed through jmx. We decided on
> using them. Thanks for the direction.
>
> Take care.
>
>
> 14 Aralık 2012 Cuma 13:03:30 UTC+2 tarihinde Martin Grotzke yazdı:
>
signature.asc
Reply all
Reply to author
Forward
0 new messages