+ Start a Discussion
nishanth0208nishanth0208 

Storing information in http sessions or using cookies?

Hello All,

Is there a way in SFDC to store variables data in sessions or in browser cookies?

please help.

Thanks.

nishanth0208nishanth0208

Thanks both of you for the replies!

But, can i use these cookies through out the session? Because i need to use these cookie values in some different class which gets executed on current page's pagereference method execution.

 

 

sfdcfoxsfdcfox

Cookies can be used throughout the entire Site, and you can choose the duration of the cookie, using negative numbers to mean "until the browser is closed" (session cookies), up through very large numbers, such as 31,536,000 (one year), or even much higher than that, depending on your implementation needs. Each class that needs to use the cookie calls ApexPages.currentPage().getCookies().get(cookieName) to retrieve the value of the cookie.