# Implementing Custom Session Handling via MySQL for Compliance/Auditability

**URL:** <https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271>\
**Category:** General Discussion\
**Tags:** perspective\
**Created:** [July 5, 2026, 2:37am UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271 "2026-07-05T02:37:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![arewa.ojelade](https://avatars.discourse-cdn.com/v4/letter/a/c6cbf5/32.png) [@arewa.ojelade](https://forum.inductiveautomation.com/u/arewa.ojelade)\
**Post date:** [July 5, 2026, 2:37am UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271/1 "2026-07-05T02:37:34Z")

</div>

Hi everyone,

I have been working on a project at Teva Pharmaceuticals where I needed to move beyond the standard session management within Ignition to meet specific compliance and audit requirements.

We are currently leveraging an Ignition architecture that requires a more robust, persistent session-tracking mechanism than the default handles. I opted to build a custom session handling system using MySQL to bridge the gap between our manufacturing plant displays and our core data infrastructure.

**The Approach:**

- **Persistent Storage:** Using MySQL to manage session states, ensuring that state information survives service restarts or failovers.

- **Auditability:** Every session transition is logged to a specific compliance table, allowing for a clear trace of user activity across the plant floor displays.

- **Integration:** Utilizing Scripting (Gateway scoped) to interact with the DB upon login/logout events, coupled with custom logic to validate active sessions.

**The Challenge:** I am curious to hear from others who have tackled custom session persistence in high-availability environments.

- How are you handling the overhead of DB writes for every session change?

- Have you encountered specific race conditions when scaling this across a distributed gateway environment?

- Are there existing patterns in the Perspective module that you feel handle this more natively, or have others found that rolling their own MySQL-backed solution is the most reliable path for highly regulated environments?

I would love to trade notes on your implementation approaches and any lessons learned in ensuring these custom handlers don't introduce latency to the UI.

Thanks!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 6, 2026, 3:08pm UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271/2 "2026-07-06T15:08:10Z")

</div>

This reeks of AI regurgitation [(see the forum rules)](https://forum.inductiveautomation.com/guidelines#stealing) but I'll let it stand in case legitimate discussion happens anyways.

As for the topic at hand:  
I would be hard pressed to imagine a hand-rolled session tracking mechanism being "more robust" than the one built in to Ignition, given that you would have to create it within the bounds of scripting (or via a custom module, if you're actually making a serious effort).  
If you actually have a justification, go for it, but _if_ anyone here has done such a thing, they're very unlikely to be willing to offer any wisdom for free.

---

<div class="post-metadata">

**Author:** ![Jasmine\_Quick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jasmine_quick/32/80380_2.png) [@Jasmine\_Quick](https://forum.inductiveautomation.com/u/Jasmine_Quick)\
**Post date:** [July 6, 2026, 7:51pm UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271/3 "2026-07-06T19:51:16Z")

</div>

Didn't IA publish a bit of a guide on how to comply to the pharma standards with Ignition, too?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [July 6, 2026, 7:56pm UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271/4 "2026-07-06T19:56:15Z")

</div>

You might also let everyone know here what compliance/auditing requirements you're trying to fulfill. It's possible it's already covered by existing functionality that you just need to enable (do you have auditing enabled already?)

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 7, 2026, 12:04pm UTC](https://forum.inductiveautomation.com/t/implementing-custom-session-handling-via-mysql-for-compliance-auditability/116271/5 "2026-07-07T12:04:54Z")

</div>

My best guess since they mention pharma is 21 CFR Part 11 which IA already has multiple resources on

> **[Meeting 21 CFR 11 Standards for Pharma](https://inductiveautomation.com/resources/customerproject/meeting-21cfr-11-standards-for-pharma)**
>
> Bachem Americas, a pharmaceutical company, designed and built a new cleavage unit for its chemical process at its Vista, Calif. facility. Inductive Automation’s Ignition software was used as a uniform HMI for the cleavage unit control system to...

> **[21 CFR Part 11 Compliance with Inductive Automation’s Ignition Platform](https://inductiveautomation.com/resources/article/21-cfr-part-11-compliance-with-inductive-automations-ignition-platform)**
>
> The Ignition platform can be configured to be Part 11-compliant, ensuring data integrity through implementation of ALCOA+ concepts. This white paper will discuss the various components of Ignition that allow for Part 11 compliance and implementation...
