BuckshotPlusPlus
  • 🤝Getting started
    • What is BuckShotPlusPlus?
    • Install
  • 📺Video tutorials
    • Getting started with bpp
    • How to use reusable components
    • How to use events
  • 👔Data types
    • Variables
    • Arrays
    • View
    • Data
    • Page
    • Event
  • 🤓The basics
    • Comments
    • Include
    • String concatenation
    • Conditions
    • Sessions
    • Static site export
  • 🔍SEO
    • Sitemap.xml
    • Meta tags
  • Advanced use
    • CSS Properties
Powered by GitBook
On this page
  • How it works
  • Session data object
  • Use cases
  • Important notes

Was this helpful?

Export as PDF
  1. The basics

Sessions

Discover what are sessions and how they work

PreviousConditionsNextStatic site export

Last updated 1 year ago

Was this helpful?

Sessions in provide a mechanism to track and manage user interactions over multiple requests. They enable you to store and retrieve data specific to a user as they navigate through your application, ensuring a seamless and personalized user experience.

How it works

Session data object

In , the session data object is a special type of data object that's accessible within pages or . This object contains various properties that provide insights into the user's session:

  • ip: Represents the current IP address used by the session.

  • id: A unique identifier for the current session.

  • lang: Specifies the user's language preference.

  • platform: Indicates the user's platform (e.g., Windows, macOS, Linux, etc.).

  • start: A Unix timestamp, in milliseconds, indicating when the session was created.

These properties can be accessed directly within your or to display or process session-specific information.

For instance, if you want to display the user's IP address, you can create a like this:

view MyIPTest{
    type = "p"
    content = session.ip
}

Use cases

  1. User Personalization: Use session data to personalize content or features based on user preferences or past interactions.

  2. Tracking and Analytics: Monitor user behavior and gather insights for analytics or optimization purposes.

  3. State Management: Maintain the state of a user's interactions, such as items in a shopping cart or progress in a multi-step form.

Important notes

  • Test your session implementations thoroughly to ensure data consistency and reliability across different user scenarios.

🤓
BuckshotPlusPlus
BuckshotPlusPlus
views
views
pages
view