Title: Read values from session storage
Last modified: January 18, 2018

---

# Read values from session storage

 *  Resolved [ricksterzh](https://wordpress.org/support/users/ricksterzh/)
 * (@ricksterzh)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/read-values-from-session-storage/)
 * Hi,
    I just upgraded to the pro version which is using Session storage instead
   of Local Storage (Cookies).
 * We already did a upload form in combination with WordPress File Upload Pro which
   uploads videos and stores data in the database.
 * All the data needed were stored from the cookie with this code_
 * ————-code begin
 * <script type=”text/javascript”>// <![CDATA[
    wfu_addEventHandler(window, “load”,
   set_url_in_terms); function set_url_in_terms() { var search = “AGB”; var labels
   = document.querySelectorAll(“.file_userdata_label”); var sid = “”; var ind = “”;
   for (var i = 0; i < labels.length; i++) if (labels[i].innerHTML.substr(0, search.
   length) == search) { var match = labels[i].id.match(/^userdata_([0-9]+)_label_([
   0-9]+)$/); sid = (match[1] ? match[1] : “”); ind = (match[2] ? match[2] : “”);
   if (!(sid == “” || ind == “”)) break; } if (!(sid == “” || ind == “”)) { var 
   label = document.getElementById(“userdata_” + sid + “_checklabel_” + ind); label.
   innerHTML = “Ich akzeptiere die [Bestimmungen](http://www.goldenezeiten.tv/bestimmungen)“;}}//]]
   ></script> ——————Code end
 * Is there a possibilty to read these values from the Session, and how?
 * Cheers Martin
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fread-values-from-session-storage%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [ricksterzh](https://wordpress.org/support/users/ricksterzh/)
 * (@ricksterzh)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/read-values-from-session-storage/#post-9877936)
 * sorry wrong code:
 * <script type=”text/javascript”>
    function wfu_getCookie(name) { var value = “;”
   + document.cookie; var parts = value.split(“; ” + name + “=”); if (parts.length
   == 2) return parts.pop().split(“;”).shift(); } wfu_addEventHandler(window, “load”,
   wfu_preload_cf7msm_data); function wfu_preload_cf7msm_data() { var cookie = wfu_getCookie(“
   cf7msm_posted_data”); var data = JSON.parse(unescape(cookie)); if (data) { document.
   getElementById(“userdata_1_field_1”).value = data.Vorname; document.getElementById(“
   userdata_1_field_2”).value = data.Nachname; } } </script>
 *  Plugin Author [webheadcoder](https://wordpress.org/support/users/webheadllc/)
 * (@webheadllc)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/read-values-from-session-storage/#post-9883801)
 * You’ll need to test this out yourself, but the session storage key is ‘cf7msm’.
   so something like this:
 * `sessionStorage.getItem('cf7msm');`
 * might work in place of:
 * `wfu_getCookie(“cf7msm_posted_data”);`
 *  Thread Starter [ricksterzh](https://wordpress.org/support/users/ricksterzh/)
 * (@ricksterzh)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/read-values-from-session-storage/#post-9898233)
 * The data is appearing in the WordPress File Upload Pro Plugin.
    Its working!
 * Changed code to:
 *     ```
       <script type="text/javascript">
       function wfu_getCookie(name) {
         var value = "; " + document.cookie;
         var parts = value.split("; " + name + "=");
         if (parts.length == 2) return parts.pop().split(";").shift();
       }
       wfu_addEventHandler(window, "load", wfu_preload_cf7msm_data);
       function wfu_preload_cf7msm_data() {
       	var cookie = sessionStorage.getItem("cf7msm");
       	var data = JSON.parse(unescape(cookie));
       	if (data) {
       		document.getElementById("userdata_1_field_1").value = data.Vorname;
       		document.getElementById("userdata_1_field_2").value = data.Nachname;
       	}
       }
       </script>
       ```
   
 * Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Read values from session storage’ is closed to new replies.

 * ![](https://ps.w.org/contact-form-7-multi-step-module/assets/icon-256x256.png?
   rev=1793363)
 * [Contact Form 7 Multi-Step Forms](https://wordpress.org/plugins/contact-form-7-multi-step-module/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/contact-form-7-multi-step-module/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/)
 * [Active Topics](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/contact-form-7-multi-step-module/reviews/)

## Tags

 * [contactform7](https://wordpress.org/support/topic-tag/contactform7/)

 * 3 replies
 * 2 participants
 * Last reply from: [ricksterzh](https://wordpress.org/support/users/ricksterzh/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/read-values-from-session-storage/#post-9898233)
 * Status: resolved