Help With Understanding Implementing Cookies in Perspective Project

I should start by saying I'm still getting used to Perspective/Web development, so maybe this isn't particularly difficult, but any help would be appreciated.

We have a project that involves scanning UUIDs around our facility, putting those UUIDs into a staging list, and running that list through an interface which runs an API. This part of the project is working.

A large goal that has eluded us is to address when network access is lost when running around our facility. When this happens, we would like to save the staging list of UUIDs to a cookie; allowing the user to restore that list when connection is restored.

We've done research and found the common way to do this through Java libraries is through servlets:

Handling Cookies and a Session in a Java Servlet | Baeldung

Chapter 13: Simple Web Applications — Definitive Guide to Jython latest documentation

How to use Cookies in Java web application (codejava.net)

I can follow the basics of these sites, but I've struggled to understand how to put it all in the context/structure of Ignition. Has anyone done something like this? Can you build a Servlet in Ignition? We have the webdev module, but I'm not sure how to utilize it for a project like this. Thanks for any help or pointers, I will be the first to admit this side of development is pretty foreign to me.

Seems like an easier solution would be to setup a UDT, or just memory tags to hold session information like this on the gateway. Bind the uuid list data bi-directionally to the tags. If the session disconnects and then restored, the bindings will pull the information back in.

I know IP addresses aren't the most secure way to validate a perspective client device seeing as you can't get the MAC address. We use the mac addresses of our scanners to setup static IPs on our network for those specific devices, then we use the IP in perspective as the device identification.

1 Like

We also have plans to implement a first party 'form component' that will handle network instability for you. Implementation is supposed to start soon, if you can wait ~months for that to be available. None of the servlet/Java/etc stuff you're reading up on is going to be particularly helpful from a module, because you won't be able to reach into Perspective's internals to do anything like that from a module.

2 Likes

That's what I was quickly picking up on, but I'm glad to get confirmation. I'll keep my eyes out for updates. @dkhayes117, thanks for the suggestion in the meantime.

1 Like

Hello, would be great if there's any update you can pls share

Thanks & Regards,

Projjwal