Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


An explanation of a small block of ASP code

An explanation of a small block of ASP code

An explanation of a small block of ASP code

I am new to programming and ASP and my boss assigned me a website to design. I had a problem and asked one of co-workers for help to fix it. He then seen the problem and had it fixed by using the code below. He is now on holidays and I can't ask him to explain the code and I can't for the life of me figure it out although it works perfectly. Would anybody be able to please give me a small description of the code below if you can decipher it. Thanks for your help in advance. JOhn

function setCookie(value1)
    userId = 'cookie';
    name1= 'module';
    expiredays = 1;

    var ExpireDate = new Date ();
    ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
    document.cookie =  escape(userId) + ":" + name1 + "=" + escape(value1) + "," + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());

    window.location = 'Files.asp';

RE: An explanation of a small block of ASP code

Someone on the JavaScript forum Forum216 should be able to answer your question if you ask there.

RE: An explanation of a small block of ASP code

The code is a function that receives a value.

The value is saved into a browser cookie and then the browser is redirect to a page named Files.asp

I assume that there is corresponding code inside Files.asp hat will read the values from the cookie.
well, heh, hmmm, looks like this was originally posted six months ago so i guess the coworker returned.  oh well.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close