3.19. <SessionDatabase REDIS>

<SessionDatabase REDIS> provides support for using GossipRedis as session database backend. For more information about GossipRedis, see Section 3.133. <GossipRedis>. <SessionDatabase REDIS> supports SessionDatabase methods to query all sessions and specific sessions for a user. These provide support for RFC 5176 dynamic authorisation support for sending Disconnect-Request and CoA-Request messages. See SessionDatabase REDIS sample file goodies/sess-redis.cfg.
<SessionDatabase REDIS> has currently experimental features and will be fully documented later.
<SessionDatabase REDIS> understands also the same parameters as <SessionDatabase xxxxxx>. For more information, see Section 3.17. <SessionDatabase xxxxxx>.

3.19.1. SessionIdentifier

This optional parameter sets the name of a Radius attribute which is used to identify a session. It is useful, for example, when the authentication request contains the session identifier attribute for the subsequent accounting session. The default value is Acct-Session-Id.
# This vendor sends id of subsequent accounting session during authentication
SessionIdentifier Vendor-Session-Id

3.19.2. SessionKey

Redis key used to store Redis Hash for sessions.
The following specials for format are available: Here is an example of using SessionKey:
SessionKey Radiator:SessREDIS:Session:%1:%2:%3:%0

3.19.3. SessionEndedKey

Optional Redis key to store Redis Set of ended sessions. If defined, session information for a session will not be deleted when ending the session, but an id of ended session will be added to Redis Set defined by this key. There is no default.
The following specials for format are available:
  • %0 is the NAS Id as defined by Radiator from the request and its attributes
Here is an example of using SessionEndedKey:
SessionEndedKey  Radiator:SessREDIS:EndedSession:%0

3.19.4. SessionUpdateKey

Optional Redis key to store Redis Hash of session updates. If defined, session will not be updated with SessionKey, but added with this separate SessionUpdateKey. There is no default.
The following specials for format are available:
Here is an example of using SessionUpdateKey:
SessionUpdateKey Radiator:SessREDIS:SessionUpdates:%0

3.19.5. NasKey

Redis key to store Redis Set of sessions on NAS.
The following specials for format are available:
  • %0 is the NAS Id as defined by Radiator from the request and its attributes
Here is an example of using NasKey:
NasKey Radiator:SessREDIS:NAS:%0

3.19.6. UserKey

Redis key to store Redis Set of sessions for a user.
The following specials for format are available:
Here is an example of using UserKey:
UserKey Radiator:SessREDIS:User:%0

3.19.7. AddSessionParamDef

AddSessionParamDef specifies the Redis Hash attributes to store session information. The general format is:
AddSessionParamDef redishashattributename, radiusattributename[, defaultvalue[, type[, formatted]]]
There is no default.
The following specials for format are available: Formats are considered when the formatted flag is set.
Supported values for type are:
  • request (the default)
  • reply
Here is an example of using AddSessionParamDef:
AddSessionParamDef username,%0,'unknown-user',request,formatted
AddSessionParamDef nas_id,%1,'unknown-nas',request,formatted
AddSessionParamDef nas_port,%2,'0',request,formatted
AddSessionParamDef session_id,%3,'unknown-session',request,formatted
AddSessionParamDef framed_ip,%{Framed-IP-Address},'unknown-address',request,formatted

3.19.8. UpdateSessionParamDef

UpdateSessionParamDef specifies the Redis Hash attributes to update session information. The general format is:
UpdateSessionParamDef redishashattributename, radiusattributename[, defaultvalue[, formatted[, operator[, attribtype]]]]
There is no default.
The following specials for format are available: Formats are considered when the formatted flag is set.
Supported values for operator are:
  • add
  • sub
  • sub_to_zero
Supported values for attribtype are:
  • postpaid
  • prepaid
Both operator and attribtype can be used for example with a hotspot service, see goodies/README.hotspot and goodies/hotspot.cfg for a configuration sample. Both operator and attribtype are currently experimental.
Here is an example of using UpdateSessionParamDef:
UpdateSessionParamDef username,%0,'unknown-user',formatted
UpdateSessionParamDef nas_id,%1,'unknown-nas',formatted
UpdateSessionParamDef nas_port,%2,'0',formatted
UpdateSessionParamDef session_id,%3,'unknown-session',formatted
UpdateSessionParamDef framed_ip,%{Framed-IP-Address},'unknown-address',formatted

3.19.9. DeleteSessionParamDef

DeleteSessionParamDef specifies Redis Hash attributes to update session information when ending a session. The general format is:
DeleteSessionParamDef redishashattributename, radiusattributename[, defaultvalue[, formatted[, operator[, attribtype]]]]
There is no default.
The following specials for format are available: Formats are considered when the formatted flag is set.
Supported values for operator are:
  • add
  • sub
  • sub_to_zero
Supported values for attribtype are:
  • postpaid
  • prepaid
Both operator and attribtype can be used for example with a hotspot service, see goodies/README.hotspot and goodies/hotspot.cfg for a configuration sample. Both operator and attribtype are currently experimental.
Here is an example of using DeleteSessionParamDef:
DeleteSessionParamDef username,%0,'unknown-user',formatted
DeleteSessionParamDef nas_id,%1,'unknown-nas',formatted
DeleteSessionParamDef nas_port,%2,'0',formatted
DeleteSessionParamDef session_id,%3,'unknown-session',formatted
DeleteSessionParamDef framed_ip,%{Framed-IP-Address},'unknown-address',formatted

3.19.10. ContextTimeout

Specifies the number of seconds to store session attributes in context. The default value for ContextTimeout is 2.
Here is an example of using ContextTimeout:
ContextTimeout 2