Results 1 to 7 of 7

Thread: DHTML Modal window session losing

  1. #1
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default DHTML Modal window session losing

    1) Script Title: DHTML Modal window v1.1

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...dhtmlmodal.htm

    3) Describe problem: Now that I have learned how to load an external page to my iframe (with try catch block in close function), I have yet another problem. I am loading a page which uses sessions to store variables (for example a captcha string). However the sessions are destroyed or not saved in if gone through the modal window. It will work fine if I had to access it directly via browser. any information is highly appreciated.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Is the page loaded inside the DHTML window from the same domain as the page launching it? If so, you should also ensure the "www" (or lack thereof) portion of the URL is the same for both pages as well.
    DD Admin

  3. #3
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Is the page loaded inside the DHTML window from the same domain as the page launching it?: Nope the page loaded inside dhtml window is calling an external page.

    --- aside from this problem I am having another issue. Yep, sure enough the window gets closed when i click the X button on external pages after adding the try catch block...however, lets say the external page is a form and then i submit the form which gives me the status of my submission (a different page, than originally loaded) in dhtml window. at that point i cant close it. for example.

    my domain a.com makes a request to page1.php in b.com. page1.php gets loaded on dhtmlwindow on my page and i can click 'X' and get it closed with try catch. lets say page1 on b.com is a form which on action goes to processpage1.php, it will get loaded but i cant close the window at that point.

    Hope it made sense.

  4. #4
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    to add to the above note: I forgot to mention my original issue.

    I am on a.com. calls page1.php in b.com on my dhtml window. page1.php in b.com actually uses session which gets passed to processpage1.php. However, it looks like sessions created within page1.php through modal window are over-written or getting destroyed when processpage1.php is rendered. if i go through normal route i mean if i loade page1.php in b.com from the url directly bypassing modal, sessions are working.

  5. #5
    Join Date
    Aug 2004
    Posts
    10,140
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm there shouldn't be anything in the DHTML window that will overwrite sessions. To confirm this, what if on a.com, you simply created an IFRAME (using the IFRAME tag) that loads page1.php:

    Code:
    <iframe src="http://www.b.com/page1.php"></iframe>
    Then, from page1.php, try and go to processpage1.php from within the iframe- do the sessions persist?
    DD Admin

  6. #6
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    yep tried that. no luck

  7. #7
    Join Date
    Feb 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank god! fixed it. It only got fixed because I own both a.com and b.com. In b.com the form which calls processpage1.php through action i had to spell out the whole url. http://www.b.com/processpage1.php. and sure enough it preserves the session and window gets closed too. I guess this is not a modal window issue rather how sessions works. But i guess a nice experience. thanks admin for your time.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •