Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 539
  • Last Modified:

Write Session Data to iFrame

I have an asp page, as seen in the attached. As you can see, the page use a Session to get the Username/Password and allow access.

I'm displaying this page in an iFrame, on machines on different domains. What I'm looking to achieve is to somehow pass the Username/Password into the session within the iFrame, so that I can navigate around the site without having to go to the login page first. Currently if I try to navigate to any other page than the Login.asp, I get a 'Session Expired' error, and it redirects to the login.asp page. So, if I can somehow pass the username and password into the remote session, via the iFrame, it should allow my to login.

The site is managed by oursleves, so some changes can be made to the login.asp page attached. LOGIN.txt
0
wint100
Asked:
wint100
  • 4
  • 3
1 Solution
 
pateljituCommented:
Pages where you navigate via <iframe> you could pass querystring something as example

<iframe id="some_iframe" src="someiframpage.asp?username=test&password=password"
width="100%"  height="90%" scrolling="no" frameborder="0"> </iframe>

and within iframe pages have common include file that checks if you have session created based on the querystring value passed, if not create session and logon.

As you mentioned iframe pages are loading from different domain, same session cannot be used you would need to create session value based on domain you load page from.
0
 
wint100Author Commented:
Sounds complicated, I'm trying to keep this as simple as possible.

I'm already passing querystring, with uname and pword, and also a parameter to forcelogin. This is all done on the login.asp page only though, no other asp pages have the code to work with the parameters passed. They only check to see if an active seesion exists, but I'm not sure how this is done. There are reference to include files in the other asp files, so maybe this is how it is checking the session.
0
 
pateljituCommented:
It would be helpful if you could provide example how iframe is used on page, also noticed in code login.asp

' Added to 3.33 R2's LOGIN page to allow auto-login
Dim forceLogin
if (Request("forceLogin") = "true") then
  forceLogin = 1
  Response.Cookies("SavedUserInfo")("UserName") = AdminObj.Mask(UCase(Request("UName")))
  Response.Cookies("SavedUserInfo")("UserPass") = AdminObj.Mask(UCase(Request("UPass")))
else
  forceLogin = 0
end if

querystring parameter are uname and upass, just want to clarify you using correct parameter name, as you mentioned pword as parameter in your earlier comment.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
wint100Author Commented:
That was just an example. The auto login works fine, and just trying to bypass te login page all together which is only possible is a valud session is active.
0
 
pateljituCommented:
Without a working sample it is a bit tricky to resolve problem.

Just to get more idea how session needs to be utilized, trying an example, please correct me

www.example.com
This domain is where login.asp resides and is working fine and able to login user and create session. Page that loads in iFrame is on the same domain i.e. www.example.com

OR

page that loads in iFrame is on another domain for e.g. www.example2.com.
0
 
wint100Author Commented:
Hi,

I found a parameter on the destination page that allowed a Referer, so I was able to bypass the need for writing the session data, as it is now handled on the Page itself.

thanks
0
 
wint100Author Commented:
Problem resolved
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now