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 7837515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:40:05+00:00 2026-06-02T14:40:05+00:00

I am storing a cookie on one page, with inputs in a form with

  • 0

I am storing a cookie on one page, with inputs in a form with this function:

<script type="text/javascript">
function WriteCookie()
{
   emailValue = escape(document.form.01_email.value) + ";";
   userIDValue = escape(document.form.01_userID.value) + ";";

   document.cookie="email=" + emailValue;
   document.cookie="userID=" + userIDValue;
}
</script>

<form name="form">
 <input type="email" class="form-textbox validate[required, Email]" id="input_10" name="01_email" size="26" value="email@email.com" />
 <input type="hidden" id="simple_spc" name="01_userId" value="1234" />
</form>

I get redirect to another page once a user submits the form, and I retrieve the cookie with this code but i need to have it find the email and userID in the cookie and insert it in the value of the inputs on this new page:

<script type="text/javascript">
    function ReadCookie()
    {
       var allcookies = document.cookie;
       alert("All Cookies : " + allcookies );

       // Get all the cookies pairs in an array
       cookiearray  = allcookies.split(';');

       // Now take key value pair out of this array
       for(var i=0; i<cookiearray.length; i++){
          name = cookiearray[i].split('=')[1];
          value = cookiearray[i].split('=')[2];
          alert("Email is : " + name + " and UserID is : " + value);
       }
    }
    </script>


    <form name="form">
     <input type="email" class="form-textbox" id="input_10" name="02_email" size="26" value="" />
     <input type="hidden" id="simple_spc" name="02_userId" value="" />
    </form>

I know a user will most likely have multiple cookies, so finding only the email and userID i’m having trouble with.

  • 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-02T14:40:10+00:00Added an answer on June 2, 2026 at 2:40 pm

    Try this to read your cookies.

    function ReadCookie(){
        var key, value, i;
        var cookieArray  = document.cookie.split(';');
    
        for (i = 0; i < cookieArray.length; i++){
            key = cookieArray[i].substr(0, cookieArray[i].indexOf("="));
            value = cookieArray[i].substr(cookieArray[i].indexOf("=")+1);
    
            if (key == 'email'){
                alert('Email is ' + value);
            }
    
            if (key == 'userID'){
                alert('userID is ' + value);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I set a cookie like this in one page: Request.Cookies[lang].Value = en-US; Request.Cookies[lang].Expires =
I'm calling a PageMethod in javascript. Like this: function DeleteBatchJS2() {$find('mdlPassword').hide(); var pswd =
I've got my php working to set a cookie storing the http_referer the visitor
I am using codeigniter and in my library file I am storing the cookie
I'm working on this project in Codeigniter and i created login and register script
I have a Rails app that is storing some user information in a cookie,
Ok, I've been racking my brain on this one solo for too long. I've
I have a login script for a small application that works by storing session
When a web form is submitted and takes the user to another page, it
I'm trying to display a web page which requires one to be logged in

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.