function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Abhilash Mishra 13Abhilash Mishra 13 

How can I handle sessions in salesforce

I want to store some information in the in session so that it can be exchange globally by different pages./
Is it possible. if not is there a way or work arround for this.

Thanks
Abhilash Mishra
Vivek_PatelVivek_Patel
Hi Abhilash,

I think there is nothing like session variable in salesforce, but you can use cookies to store your data.

If that's not possible, kindly provide the type and volume of data you want to store.
Abhilash Mishra 13Abhilash Mishra 13
there are some id's i need to exchange. between pages during a single session.
can i create any gloabal varialble and reference it with $.
Vivek_PatelVivek_Patel
Yes, you can do that, but if you navigate to the different page, you might lose the values. better you set the cookie and read it in any page you want.
Abhilash Mishra 13Abhilash Mishra 13
but if some one clears cokie or cokies are blocked. then data can not be accessed
Vivek_PatelVivek_Patel
You can set them as session cookies, they can not be blocked, because if they are blocked, salesforce itself will not function.
Abhilash Mishra 13Abhilash Mishra 13
is there any example or blog on that?
 
Vivek_PatelVivek_Patel
Hi Abhilash,

Skip the expire part from the cookie definition to creat the cookie.
Abhilash Mishra 13Abhilash Mishra 13
I have read that by using the virtual class and page controllers u can share data among pages. could this approach be helpful im mantaing a gloabal data set and sharing between different pages.