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
AnjaanAnjaan 

Custom Session Handling

Hello All,


I am developing a custom application using visualforce. The application gets its data from another site. I want to add some data to be remembered (Session). How can i set the session if possible. If not, then what to do in order to preserve the data to be used in other classes.

waiting for your kind reply

Thanks and Regards
Osman Ashraf Bajwah
Software Engineer

JeremyKraybillJeremyKraybill
Osman, I'm not aware of an explicit way to get at the underlying session and put transient data in there. The way I would accomplish this would be to create a new custom object in SF with all the session data I wanted to store, and then at the entry point to the VF application, pull it from the third party source, save it to that custom object, and then retrieve the custom object in other controllers that need the data. For the key of this custom object, I would use either the user's ID or the $Api.Session_ID variable. The Session_ID may be a better choice if the data should never live across sessions.