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
arosysarosys 

Alternative to manage session in apex

I searched for maintaining session variable , but i found session variables are not there in salesforce.

 

Please suggest any alernative to this in case i want to make a shopping cart.

 

Thanks

Sonam_SFDCSonam_SFDC

Hi Arosys,

 

Did you get a chance to explore the Cookie Class in Apex which you can utilize to maintain session:

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_sites_cookie.htm

 

sandeep@Salesforcesandeep@Salesforce

You can use in apex 

Userifno.getSessionId(); to get session id

arosysarosys

Scenario is i want to maintain session variable like we do in php,cf etc.

for example like creating a shopping cart.

in which we maintain a session list variable to store information about the products , quantity etc.

for login and guest uesrs.

 

 

sandeep@Salesforcesandeep@Salesforce

For that you should use cookies.