(6.0.3) sessionCount has never decrease after logout

18 views
Skip to first unread message

Maksim Kopeyka

unread,
Dec 5, 2019, 12:53:21 PM12/5/19
to CAS Community
Hi Guys,

I have a 1 instance of CAS and 1 instance of CAS ADMIN on localhost.
I see in cas admin "sessionCount" value is incremented after each login to CAS. However value won't be changed if I click "log out".

I don't see any errors in CAS console. Is it a bug in CAS?

Andy Ng

unread,
Dec 6, 2019, 7:22:25 AM12/6/19
to CAS Community
Hi,

It is a normal behavior for sessionCount to remain the same after user logout. No need to panic :)

CAS does not relies on creating and destroying an entire session for verifying whether or not user are login or not.

Instead, CAS uses the cookie called TGC for SSO verification, you can use a common cookie browser for your web browser to see TGC in action (it literally named TGC in your CAS site cookie).

What happen is:
1. User login, session create, TGC cookie created
2. User logout, TGC cookie destroyed 
3. (If you haven't set anything, and by default) User close browser, session destroyed

You can know more about TGC and CAS workflow here: https://apereo.github.io/cas/6.1.x/protocol/CAS-Protocol.html#cas-protocol

I saw in some old thread in CAS 3 or CAS 4(can't remember specifically), some people suggest that removing the session after user logout will allow better performance for server. Which I didn't verified myself...

However with today server being so powerful, I doubt there is a need for destroying user session after user logout, only destroying the TGC cookie is ok.

See if the above info helps.

Cheers!
- Andy


Ray Bon

unread,
Dec 6, 2019, 11:13:52 AM12/6/19
to cas-...@apereo.org
Can an application remove the TGC?
If your application calls https://server/cas/logout, CAS will perform a single logout for all services the user has logged into (configurable in service registry) and mark/destroy the TGT (server side part of TGC).

Ray
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.
Reply all
Reply to author
Forward
0 new messages