Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:09:21+00:00 2026-05-26T09:09:21+00:00

I have a javascript app running in a home page component. It calls into

  • 0

I have a javascript app running in a home page component. It calls into a web service, which in turn calls the salesforce API. I would like to use the API_Session_ID variable to save re-logging in. How do I expose this to the javascript running in my home page component? Ideally I would like to use apex to render a small piece of script, initialising a javascript variable with the API_Session_ID variable, onto all pages, but I can’t see how to do this.

Note – I can’t use VF as the app is running in a home page component. The normal solution for that (run as VF in an iframe) is not available to me as I need to access the javascript objects in the main page, which I can’t do from an iframe.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:09:21+00:00Added an answer on May 26, 2026 at 9:09 am

    Ok so I figured this out. There’s a value ‘sid’ in the session cookie, and that’s what one needs with a bit of tweaking. Easy when you know how! Here’s the link:

    http://forums.sforce.com/t5/forums/forumtopicprintpage/board-id/general_development/message-id/7209/print-single-message/false/page/1

    It’s a bit out of date. I pass the cookie sid value, and window.location.host to my php web service. The php to make these values work is:

    $sidparts = explode("!", $feed->sid['value']);
    $location = "https://".parse_url($feed->server['value'],
        PHP_URL_HOST)."/services/Soap/u/20.0/".$sidparts[0];
    $sessionId = "{$feed->sid['value']}";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a javascript app running in a home page sidebar component. I need
We have a site running on MOSS 2007 which makes calls to custom web
I have a very nice web app (HTML5, javascript,CSS) running on my website. It's
I have a JavaScript widget which communicates with my Rails app by creating tags
I have a web app that is heavily loaded in javascript and css. First
I have a .NET app running inside a Peoplesoft web portal IFrame. What I
I have a RoR app running rails 2.3.8 which makes use of the Rails
I have a lock in my c# web app that prevents users from running
I have an MVC 3 web app that has an Action which I need
I am developing a web app but running into a few small snags. I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.