- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
10-26-2009 04:12 AM
This is a bit of tricky topic as it depends on what you'd like to do and what constitutes a session for you. Unfortunately there aren't class to set session variables like you might find with JSP or PHP, but you can try a few of these options,
1. You can create a session if all pages involved use precisely the same controller and controller extensions. A tutorial can be found here.
3. You could use Custom Settings, a new feature on the Platform.
10-26-2009 04:46 AM
Storing a value in Session Object :
String sessionSet="theKK"; session.setAttribute("MySession",sessionSet);
String getSessionValue= (String)session.getAttribute("MySession");
Thanks & Regards ,
10-26-2009 04:52 AM
Yeah I've had similar requirement before but there isn't a feature available as you've described it. I would recommended reading throught the options I've summarised, and choosing one from there. If the pages are completely different and it doesn't make sense for them to use the same controller I'd suggest using 'Custom Settings'.
10-26-2009 06:02 AM
In first Page I've selected a Organization, we nee
10-29-2009 05:38 AM
I have the same requirement as Krish.
The thing is that I can't see the point in using Custom Settings since, as it says in the documentation, "After you save a custom setting, you cannot change this value".
How do you plan to use that feature if you are unable to set an specific value each time a user enters the page?
10-30-2009 12:54 AM
I think this reply to another post is one of the solutions to our requiremet
02-09-2011 04:39 AM
I have the same question, and the provided answers do not seems to be problem solvers.
- Using cookies is not possible, I want more secure place to store the values
- Using the same controller also is not possible, and I doubt that this solution will work in case the user hit CTRL+F5
- I cant find any example on how to read/write to custom settings (as mentioned in one of the answers) in Apex for each anonymous user, I want each user's data to be accessible only by him