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

  • Home
  • SEARCH
  • 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 8637131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:24:05+00:00 2026-06-12T10:24:05+00:00

I have an application that uses window.name as a fallback storage to sessionStorage .

  • 0

I have an application that uses window.name as a fallback storage to sessionStorage.

Example (simplified for brevity):

function setData(data){
  window.name = JSON.stringify(data);
}
function getData(data){
  return JSON.parse(window.name);
}

This all works fine and dandy in just about all browsers. However, I have recently discovered that this DOES NOT work in IE7 and below when the window is launched with a target.

<a href="winning.html" target="bob">winning.html</a>

If I launch the winning.html file from the above A, using IE7, getData will always return “bob”, regardless of what we try to set through setData.

If I modify the launch link like so (remove the target), it will set and remember data correctly.

<a href="winning.html">winning.html</a>

The problem is that I do not always have control of that originating link. Is there any way around this?

  • 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-06-12T10:24:08+00:00Added an answer on June 12, 2026 at 10:24 am

    As is often the case, putting this problem down for a couple of days, and then coming back to it fresh has revealed the answer.

    I tested the bug using this script (from this Sitepoint article) for the window.name session storage.

    As you might guess, this script is not affected by the bug in my original post. Why? What makes this one work, and my simple example above not work? This bit right here is the key:

    // page unload event
    if (window.addEventListener) window.addEventListener("unload", Save, false);
    else if (window.attachEvent) window.attachEvent("onunload", Save);
    else window.onunload = Save;
    

    For some reason, you MUST save the data back into the window.name container within the window’s unload event.

    Beware of using only the onunload method for this, as mobile safari will not remember the data. To get mobile safari to persist the data in window.name, you must save it manually before onunload. Essentially, for maximum compatibility, you must do both: save in onunload; save manually whenever new data is set.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF application that uses a custom window frame. My problem is
I have installed my windows application that uses TeeChart ActiveX (a COM Component for
I have a Windows Forms application that uses some Application.Idle handlers to change the
If you have a windows service and a windows forms application that uses the
I have an application I'm writing for Windows 8/WinRT that uses the StreamSocket API
I have an application that uses a ResourceDictionary to set the styles, which it
I have an application that uses Hibernate. It generated the following SQL statement. I
I have an application that uses multiple WebViews. Nowhere do I set the priority
I have an application that uses RPC for interprocess communications. Turns out that synchronous
I have an application that uses rest to communicate to a server, i would

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.