Is there any unique session ID generated when the site is loaded that's accessible to the back-end scripts?
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Sessions are created for temporary use, so they are stored at client-side (browsing cookies). They are used to remember who was using your application. If you need to store the cookie used during the application use, you will have to create a log, in a dataset or otherwise.
OK - I copied the code on relevant pages under existing code, respecting an empty line in between }); and the new code. I hope this is correct!
I will submit data now. Where should I look for the session IDs? Does it get automatically added to a dataset or do I need to create one?
As soon as you setup a session ID at the session level, it is usable in the whole website and you can retrieve it using the session.getItem() method. But if a person gets a link for a page that does not go through the main page, it won't have the session ID setup. So in that case, you would need to copy this code over to other pages.
You should copy all the code I did and paste on the page you want to manipulate this sessionId.
You can create your own using a NPM Package called UUID that generates random UUDIs.
Just install the NPM Package and import it.
import { session } from "wix-storage" import { v4 as uuidv4 } from 'uuid' session.setItem("sessionId", uuidv4()) //This creates the session $w.onReady(() => { let sessionId = session.getItem("sessionId") //This gets the session console.log(sessionId) //Just logging to check it out. })
I have the same question, cannot find anything to this topic
I need this ID too!!!