►Q◄ Guest user and session data

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

►Q◄ Guest user and session data

Post by BenHayat »

@ Support

1) Does Aware maintain session data for Guest user?
2) Does Guest user consume less memory than a LoggedIn/Register user as far as the server is concern?
3) I want to open up a series of features to Guest users, what Aware features will I lose if take advantage of Guest user?

Thank you in advance!
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: ►Q◄ Guest user and session data

Post by aware_support »

1) Session ID is maintained internally by Aware IM but there is no "LoggedInSystemUser"
If you want to maintain the session data you have to do it manually by creating a special object GuestSession during LoginNotification and storing it's ID (obtained using the SESSION_ID function):
CREATE GuestSession WITH GuestSession.SessionID = SESSION_ID(),SomeOtherAttribute=...

Then every time you need to find out which session you are dealing with in your rules you need to find it rather than using LoggedInSystemUser:
FIND GuestSession WHERE GuestSession.SessionID = SESSION_ID()

2) No
3) LoggedInSystemUser (but there is a workaround) - see 1)
Aware IM Support Team
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: ►Q◄ Guest user and session data

Post by BenHayat »

Thank you Support;
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: ►Q◄ Guest user and session data

Post by BenHayat »

CREATE GuestSession WITH GuestSession.SessionID
Shouldn't that be GuestSession.ID?
by creating a special object GuestSession
Support, in the section where we create/design objects, do we just create an object called "GuestSession" or is there a way to ask Aware to create that GuestSession object with special attributes, like a Gantt object?

Does the name "GuestSession" have any special meaning to Aware?
Could you please expand on this. I'm not sure I understand you.

Thanks!
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: ►Q◄ Guest user and session data

Post by aware_support »

GuestSession is your own object - you can have any name you want and any attributes you want. The important thing about this object is that it should store the ID of the session obtained by calling the SESSION_ID function. It's up to you how you name this attribute, but it shouldn't be ID, which is a reserved name.

When the ID of the session is stored in this object you can always retrieve the instance of the object corresponding to this ID whenever you want it. So in a way it's a manual management of the LoggedInSystemUser object.
Aware IM Support Team
BenHayat
Posts: 2749
Joined: Thu Dec 23, 2010 5:48 am
Location: Fla, USA
Contact:

Re: ►Q◄ Guest user and session data

Post by BenHayat »

Got you. I thought GustSession was a special undocumented object.

It's clear now.
Thank you!
pureist
Posts: 427
Joined: Sun Jan 24, 2016 10:00 pm

Re: ►Q◄ Guest user and session data

Post by pureist »

V's suggestion is great for when you want to display a website immediately the page is loaded as well as removing the need for the user to EVER see/use the Aware User login screen, and using Guest user, and instead having a custom login panel/popup and procedure integrated in the actual application UI.
say, a consumer facing public website accessible by customers and non-customers, but which needs to have functionality which allows customers to 'login' and everything ordinarily associated with it.

If an interaction or activity/event occurs that requires updating data to be thereafter associated with a Customer, then the following rule is run first, before whatever customer related updating related rules/actions/sub-processes are necessary to effect the updating of relevant data:

This assumes a, LoginNotification\When login notification is received, rule created an instance of an object called 'ApplicationSession'.

rule1Find_ApplicationSession
FIND ApplicationSession WHERE ApplicationSession.aID=Session_ID()
rule2ValidateFound
IF: SEARCH_COUNT<>1
THEN: REPORT ERROR 'APPLICATION ERROR: '+SEARCH_COUNT+' Application Sessions with this Session`s ID exist. Inform System Admin immediately.'

<other rules/sub-processes as required>

An example 'LoginNotification\When login notification is received' rule might be:

rule1Create_ApplicationSession
If LoginNotification.IsGuest='No' Then
CREATE ApplicationSession
ApplicationSession.aID=Session_ID()
ApplicationSession.bLoginTimestamp=CURRENT_TIMESTAMP
ApplicationSession.cUserLoginName=LoggedInRegularUser.LoginName
ApplicationSession.gRemoteAddress=LoginNotification.RemoteAddress
ApplicationSession.hReferringURL=LoginNotification.ReferringURL
LoggedInRegularUser.yaLastSession=ApplicationSession
INSERT ApplicationSession IN LoggedInRegularUser.zzSessions

Else
CREATE ApplicationSession
ApplicationSession.aID=Session_ID()
ApplicationSession.bLoginTimestamp=CURRENT_TIMESTAMP
ApplicationSession.gRemoteAddress=LoginNotification.RemoteAddress
ApplicationSession.hReferringURL=LoginNotification.ReferringURL
Post Reply