User Manual

Write To Session Storage

19/5/25
Write To Session Storage

The Write To Session Storage action is used to temporarily store data during an application session. With this action, data generated from user interactions is only stored in the browser for the duration of the current session. When the session closes (e.g., when the tab is closed), the data is automatically deleted.

Technical Features

  • Temporary Data Storage: Data is only stored for the duration of the current session.
  • Key-Value Structure: Each piece of data is stored and can be read using a key.
  • Data Type Compatibility: Text, numbers, and objects formatted with JSON.stringify() can be stored.
  • Secure and Lightweight: Provides clean memory management as user data is stored temporarily on the device.
  • Web and Mobile Compatible: The action is supported on both web and mobile applications.

Write To Session Storage Action Application Steps

1. Define the Action in UI Design

  • Log in to the Kuika platform.
  • Apps screen, open your project.
  • Go to the UI Design module.
  • Select the component to which you want to add the action (e.g., a button).
  • In the Properties panel on the right, select the Local Storage → Write To Session Storage action from the ADD ACTION menu according to the trigger event (Initial Actions, OnClick, OnBlur, etc.).

2. Configure Action Parameters

  • Key (String – Required):
    • The name of the data to be stored in session storage.
    • This key is used with the Read From Session Storage action to access the relevant data.
    • Example: “currentStep”, “formStatus”.
  • Value (String/Number/JSON – Required):
    • The data to be stored during the session.
    • Example: “step3”, user.id, JSON.stringify (lang: ‘tr’, theme: “dark”).

Use Case: Tracking Form Progress

In a multi-step form, the step the user is on is saved to Session Storage as they move from one step to the next. Even if the page is refreshed, the user will continue from the same step.

Application Flow:

  • +ADD ACTION → OnClick → Local Storage → Write To SessionStorage
  • Key: “activeStep”
  • Value: “step3”

Write To Session Storage Action Advanced Customizations

  • Form Session Protection: You can keep track of which step of a form the user is on even if they refresh the browser while filling out the form.
  • Role/Permission Information Storage: After the user logs in, screen authorizations can be made dynamic by storing role information in the session.
  • Multiple Tab Warning: Tab control can be performed with different session data specific to each tab.

Technical Risks and Controls

  • Session Termination: Data is lost when the page tab is closed. If persistent data is required, Local Storage should be preferred.
  • Key Collision: If the same key is overwritten with multiple data, the previous data is deleted. Unique naming should be ensured.
  • JSON Formatting: If JSON is to be stored as Value, JSON.stringify() should be used when writing and JSON.parse() when reading.
  • Browser Restrictions: Each browser has session storage limits (~5MB). Avoid storing excessive data.
  • Storing Sensitive Data: Data such as user names and role information can be stored; however, sensitive information such as passwords or tokens should never be stored in plain text.

The Write To Session Storage action is ideal for developers who want to store temporary data for the duration of a session. It can be used effectively in many scenarios, such as personalizing the user experience, saving temporary selections, and managing form processes. With its clean and controlled data storage structure, it offers a simple yet powerful solution for Kuika projects.

Other Related Content

No items found.

Glossary

No items found.

Alt Başlıklar