What i want to do is simply allow some users (non salesforce users) to view some specific records , so i have created for each user an email and a password for authentification purposes and once logged in ( the user enters the email and the pass in a authentification form that i can verify in the database) i need to keep track of this user as he navigates from one page to another in order to display only the records related to him

the problem is that ,as far as I know, there is no sessions in salesforce as it is in php for example.So i want to know if there is a way to do that in order to simulate sessions functionality to keep track of these users.

any help will be highly appreciated.

  • 2
    "the user enters the email and the pass in a authentification form that i can verify in the database" You need to be very careful here, this approach likely violates the Salesforce TOS as they would likely take the view that you should be using regular users / community users for this functionality. Feb 16, 2016 at 10:22
  • There's plenty of authentication and identity management features in salesforce that will do this for you. You'll need to have your users, as users in salesforce with some type of license though. Feb 16, 2016 at 11:00
  • So, we can not in salesforce create public websites for non salesforce users at all unless they have salesforce license am i right ? (I am very new to salesforce ) i am thinking about a shopping website when you have to use sessions for this purpose ( it is not possible to get everybody to have a license inorder to use the website). Feb 16, 2016 at 11:15

2 Answers 2


No, there is no session information or security for non-Salesforce User users. You should take a look into Community Cloud to meet your requirements.

If you continue down your current path then you are likely to be in violation of the Master Subscription Agreement which you agreed to when purchasing your Salesforce licenses.

  • i do not know i am violating salesforce TOS. Can Community Cloud allow me to do that without buying a license for the external users in this context , or there is no other way out ? Feb 16, 2016 at 11:20
  • If you need external users to authenticate and you want to stay within the TOS there is no other way out. Try talking to your Salesforce AE about options. Feb 16, 2016 at 16:15
  • Salesforce already does session handling (and all other low level stuffs which you would do in other web frameworks) internally and you don't need to worry about handling it internally in your code.

  • Along with this Salesforce has User Management and Security features out of the box which you can use from Setup -> Manage Users -> Users and create a new user

  • Then choose the user or profile to decide on what level of access you want to provide

If you really want to implement access restrictions I would highly recommend reading this overview page first: https://developer.salesforce.com/page/An_Overview_of_Force.com_Security

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .