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
Ali Khan 41Ali Khan 41 

how can i logged out the user after 5 minutes using cookies if the user do not perform any activity in custom login page?? In Apex Page

pankul guptapankul gupta
You can control the length of time before you are logged out by going to Setup > Security Controls > Session Settings. 
It will be global throughout the org.
Ali Khan 41Ali Khan 41
Pankul Gupta.. thanks for replying.
but i have one question.. session settings is fot standard users and for your org.. but i am creating a custom login page. i have to know about the custom login page not for org login .. can u plz tell
Greg CooganGreg Coogan
A custom login page will not impact how the session is created. The session is tracked by Salesforce and not related to your method of logging in.

If you want to set the length of time globally, as Pankul said, go to: Setup > Security Controls > Session Settings

Additionally, if you want to set it on a custom profile, go to Setup > Profiles > {Custom Profile Name} > Session Settings
Akshay_DhimanAkshay_Dhiman
Hi Ali Khan 41 


Registering a Site domain and Maintaining a Session
For all those people who want to register and free force.com site and maintain a session for users, I request you to first create a fresh developer.force.com account even if you have one and follow the following steps.

WORDS OF WISDOM
Instead of finding out why the problem is occurring in your existing portal and debugging it, create a new one and copy all your objects through workbench(If you don't know how to do this, share your email id and I will mail you the ppt to transfer objects from one salesforce account to another), copy and paste visualforce pages and Apex classes to your new force.com account.

STEPS
1.Customer Portal -> Settings -> Activate the portal, Enable Self Registration, Set Default New User License as Customer Portal Manager Standard, Set Default User Role as User and Default New User Profile as Customer Portal Manager Standard.
2.Create an Account and copy its Account ID
3. Manage Users->Roles->Company size based sample-> Set up Roles->Either Add Role or Assign to an existing role the above account created.
4.Develop->Sites->Search availability and register a domain
5. Edit the Site Details by providing the name and other details. To start with keeping the homepage as SiteLogin, Change Password as ChangePassword page and Profile Page as MyProfilePage.
6.Activate the Site
7. Click on Site Name and go to Login Settings->Edit->Select the customer portal so created
8. Now the site is activated and login is enabled
9.Go to SiteRegisterController page->Edit -> Replace the default PORTAL_ACCOUNT_ID with the above copied Account ID
10. Go to MyProfileController->Edit->Comment the if condition which throws the exception in case of Guest User.
11. Go to SiteLoginController, change the return value of the login method with ‘return Page.MyProfilePage;’
12. Go to Develop ->Sites->Click on Site URL
13. If all the steps are done correctly, the Site will show hyperlinks for NewUser, ForgotPassword, and Login on the Header as well as on the Output Panel.
14. Click on New User, enter the details and on clicking submit you will be redirected to the Login page. Enter your username and password registered. If all the above steps are done correctly, you will be directed to the MyProfilePage which will show you the logged in user credentials along with change password button and a logout button.
15. Copy paste the same URL on another browser or private browsing or incognito window and you will see the message of authentication required.
16. If you click on Logout, you will be redirected to the login page again.

Thank you

Akshay
Shubham NandwanaShubham Nandwana

Hi Akshay,

I would like to have the ppt to transfer objects from one salesforce account to another using workbench. Does all the data (rows) will also be transferred.
Email Id: shubhamnandwana18@gmail.com

Thanks in advance.
Shubham