cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Alfresco Ticket Session Expiration Time ?

nirvanvjain
Champ on-the-rise
Champ on-the-rise
Hi Folks,

We are using HTTP Client through which we call Alfresco Login API (Webscript) and get the Authentication ticket and I strongly believe that session expiration will also be applicable to "Alfresco Authentication Ticket" which we configure in web.xml of alfresco application.

I have multiple alfresco servers and I am using both the servers simalteneously i.e. Alfresco01 & Alfresco03 and calling their webscripts with their respective authentication ticket(s), But I have to get the tickets multiple time in my code which affects the performance of the application. I want to get all tickets from all available servers (& also use the same ticket for calling multiple webscripts multiple times) and will go for new ticket only if that ticket gets expire (ticket's session gets expire or ticket is useless for me).

Can some body help in this ? Any pointers ? Any links ? Any ways to get session details from ticket? Any workaround to improve performance ??

Thanks!
-Nirvan
3 REPLIES 3

mitpatoliya
Star Collaborator
Star Collaborator
As far as I know that the problem of ticket expiration you are facing is because of the switching between two servers.

check this out.
http://stackoverflow.com/questions/7426878/alfresco-ticket-validity

nirvanvjain
Champ on-the-rise
Champ on-the-rise
Hello,

First of all thanks a ton to Mit.

I am not facing ticket expiration issues but I am in to confusion that

Is [u]Alfresco ticket expiration totally seperate from the session expiration time mentioned in web.xml ?
i.e. web.xml session expiration time is 20 minutes still ticket expiration is 1 hours which is default ???

Thanks!
-Nirvan

deepak1987
Star Contributor
Star Contributor
Hi Nirvan,

As per my knowledge, The expiry of an Alfresco Ticket depends on following properties in "../tomcat/web-apps/alfresco/WEB-INF/classes/alfresco/repository.properties" file.

Default settings in Alfresco 4.0.0 EE:

# Do authentication tickets expire or live for ever?
# if set to "false" then, ticket will live for ever, till user log out from the system or Restart the Server. Because tickets are stored in cache memory.
# if set to "true" then, ticket will expire based on "expiryMode" & "validDuration"

authentication.ticket.ticketsExpire=false


# If ticketsEpire is true then how they should expire?
# Valid values are: AFTER_INACTIVITY, AFTER_FIXED_TIME, DO_NOT_EXPIRE
# The default is AFTER_FIXED_TIME
authentication.ticket.expiryMode=AFTER_FIXED_TIME

# If authentication.ticket.ticketsExpire is true and
# authentication.ticket.expiryMode is AFTER_FIXED_TIME or AFTER_INACTIVITY,
# this controls the minimum period for which tickets are valid.
# The default is PT1H for one hour.
authentication.ticket.validDuration=PT1H

The above properties are used in InMemoryTicketComponentImpl class. Check getNewTicket() method of this class for details.


if you want to persist a ticket then, refer this post https://forums.alfresco.com/en/viewtopic.php?f=7&t=40905. Not sure about pros and cons of persisting a ticket.

Edit "../tomcat/shared/classes/alfresco/extension/ehcache-custom.xml" as follows

Find

< cache
name="org.alfresco.cache.ticketsCache"
maxElementsInMemory="1000"
eternal="true"
overflowToDisk="true"
statistics="false"
/ >

and change to

< cache
name="org.alfresco.cache.ticketsCache"
maxElementsInMemory="1000"
eternal="true"
overflowToDisk="true"
diskPersistent="true"
statistics="false"
/ >



Please share if you get something.