Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- 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
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Visualforce Development
- :
- Re: Storing and Accessing of Session variables ...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-26-2009 03:58 AM
How to store variables in Session and how to acces
Regards,
KK
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-26-2009 04:12 AM
Hey
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.
2. You could use cookies.
3. You could use Custom Settings, a new feature on the Platform.
Cheers,
Wes
Want to master the Force.com Platform? You need the Salesforce Handbook.
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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 ,
KK
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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'.
Wes
Want to master the Force.com Platform? You need the Salesforce Handbook.
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-26-2009 06:02 AM
In first Page I've selected a Organization, we nee
Thanks,
KK
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-29-2009 05:38 AM
Hi all,
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?
Thanks,
Susana
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-30-2009 12:54 AM
I think this reply to another post is one of the solutions to our requiremet
http://community.salesforce.com/sforce/board/messa
Re: Storing and Accessing of Session variables in APex Page aswell in controller
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
02-09-2011 04:39 AM
Hi,
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

