{"title":"Liquid Session Variables","slug":"liquid-session-variables","url":"https://support.storeconnect.com/articles/liquid-session-variables","url_markdown":"https://support.storeconnect.com/articles/liquid-session-variables.md","subtitle":null,"summary":"Store and retrieve temporary key-value data that persists across pages during a user\u0026#39;s browsing session. Set values with the session tag and read them anywhere using session_variables.","type":"Developer_Documentation","video_url":"","keywords":"liquid, liquid session variables, session variables, session tag, session_variables, temporary storage, key-value storage, persist data across pages, liquid objects, liquid tags, theme development","last_modified":"2026-08-21T07:12:35+0000","body_markdown":"A session variable is a temporary storage unit that holds data for a user's session on a website. It retains information fed to it while the user is active on the site and disappears when the session ends. A session usually ends because the browser was closed or the session expired. Liquid session variables allow you to temporarily store information that can be utilized within your Liquid theme.\n\nFor instance, you can capture specific user data while they navigate through a particular section of your site. Later, you can use this information to perform personalized actions or display relevant content based on the data gathered from the user.\n\nA key feature of these variables is their accessibility throughout your store. They can be created, updated and retrieved anywhere in the store.\n\n## Functionality of Session Variables\n\nSession variables consist of a key and a value. The key helps reference the variable wherever it is intended to be used, while the value represents the data stored in it.\n\nHere’s a simple example of how to set a session variable.\n\n\n```liquid\n\n{% session title: \"My Store\" %}\n```\n\n\nAnd here is how you retrieve that value:\n\n\n```liquid\n\n{{ session_variables[\"title\"] }}\n```\n\n\nThe output here would be **My Store**\n\nIt is also helpful to note that session variables can store values derived from other variables.\n\nExample where the store is named **Acme Store**.\n\n\n```liquid\n\n{% assign name = current_store.name %}\n{% session title: name %}\n```\n\n\n\n```liquid\n\n{{ session_variables[\"title\"] }}\n```\n\n\nOutput = **Acme Store**.\n\n## Important Note\n\nThese variables are declared within tags, and their results can be accessed using objects. Note that they are declared using session instead of assign."}