Written by

Question sansa stark · Aug 16, 2016

CSP Session

Can anyone explain me how to create a dynamic session in CSP?

Comments

Fabian Haupt · Aug 16, 2016

Can you elaborate what you mean by that? Every incoming request automatically gets assigned a new session, unless it carries cookies with it that tie it to an existing one. 

0
Dmitry Maslennikov · Aug 16, 2016

What do you mean by dynamic sessions ?
Web sessions in Caché only two types, preserve or not. Preserve just keep working in the same process, for all request in this session, and keeps every locks. By default sessions, instead, only keeps data in %session.Data, and release locks after end of request.

0
Timothy Leavitt · Aug 16, 2016

If you're talking about storing dynamic data along with the session, see the documentation on %session.Data. This is just a multidimensional property - so you can do something like:

Set %session.Data("hello","world")=15

And then reference that data in a request later in the same session.

For a more advanced approach - for example, if there's a large amount of data related to the session - you could use one or more tables instead, and clear data when appropriate by implementing OnEndSession in a subclass of %CSP.SessionEvents and configuring that class as the session events class for your web application (in the web application's security settings).

0