I’ve configured a form submission script to record the logged in user, if one exists, as part of the form data submission. It functions as expected in the designer, but in browser I’m not seeing any session info pass through the form built in parameters. Instead I’m using the old system.perspective.getSessionInfo() and that’s working just fine.
I’m happy with my work around, but I’m puzzled why I’m not receiving any user data.
# sessionContext is dict-like; convert safely
sessionDict = dict(sessionContext) if sessionContext else {}
# Log keys to help diagnose auth/session structure
logger.info("sessionDict keys: %r" % sessionDict.keys())
# Resolve username
userName = "No User Logged In"
userBlock = sessionDict.get("user")
if isinstance(userBlock, dict):
userName = userBlock.get("userName") or userBlock.get("username") or userName
else:
# If userBlock is missing or not a dict, log what it is
logger.info("userBlock type=%r value=%r" % (type(userBlock), userBlock))
logger.info("Submitting form name=%r area=%r userName=%r sessionId=%r" % (
name,
formContext.get("area") if isinstance(formContext, dict) else None,
userName,
sessionDict.get("id")
))
![]()
If I try to print just sessionContext from the built in form submission component, I receive the following (with IP redacted) ":
{"id":"a2e3cb5d-2160-4c89-97dd-2f66d028e3d2","device":{"type":"browser","identifier":"b704d262-8bae-491a-9fb6-252ef7138628","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36","settings":{"pullToRefresh":true,"preventSleep":false},"accelerometer":{"timestamp":0,"x":0,"y":0,"z":0},"timezone":{"id":"America/Los_Angeles","utcOffset":-8}},"gateway":{"address":"redacted","timezone":{"utcOffset":-5,"id":"America/New_York","name":"Eastern Standard Time"},"connected":true},"geolocation":{"enabled":false,"permissionGranted":null,"options":{"accuracy":"balanced","maximumAge":0},"data":{"latitude":null,"longitude":null,"altitude":null,"accuracy":null,"altitudeAccuracy":null,"heading":null,"speed":null,"timestamp":null}},"locale":"en-US","timeZoneId":"America/New_York","user":{},"timestamp":1771449445311}

