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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:49:27+00:00 2026-06-03T05:49:27+00:00

I have this slideshow I’m building and the client wants a tracking cookie to

  • 0

I have this slideshow I’m building and the client wants a tracking cookie to report where they have already been on the site, and load a different batch of images based on that.

There are 9 images in total, set into batches of three. I’ve done a random image loader before with PHP, just need some advice on how to do this here.

Thanks!

  • 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-03T05:49:28+00:00Added an answer on June 3, 2026 at 5:49 am

    You can create cookies with the images Id’s to look if they match the cookies of the user. If they match, then this means that the user already see them and you show others.

    A simple script to do this in javascript:

    Also you can do this through PHP, read this http://php.net/manual/es/function.setcookie.php (It’s really well explained)

    function createCookie(name,value,days) {
        var expires = "";
        if (days) {
            var date = new Date( );
            date.setTime(date.getTime() + (days*24*60*60*1000));
            expires = "; expires=" + date.toGMTString();
        }
        else expires = "";
        document.cookie = name + "=" + value + expires + "; path=/";
    }
    
    function readCookie(name) 
    {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for( var i=0;i < ca.length;i++) 
        {
            var c = ca[i];
            while (c.charAt( 0)==' ') c = c.substring(1, c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
        }
        return null;
    }
    
    function eraseCookie( name) 
    {
        createCookie(name,"",-1);
    }
    

    Now, to create cookie, do the following:

    createCookie('cookiename', 'cookievalue', false);
    

    To evaluate the cookie, do this:

     var cookie = readCookie('cookiename');
    
     // var cookie will be null if there is no cookie to read.
     if(cookie == 'cookievalue'){
       //do something
     }
    

    To delete it:

    eraseCookie('cookiename');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure if this is possible but I have a slideshow on my site
I have this slideshow that I'm trying to simply move up, but I can't
ok, so i have this slideshow.html containing just a bunch of pictures, and the
I have this code to run a slideshow (this is only part of what
I have this slideshow with a overlay that pops up on hover, you can
I have tweaked this Slideshow script and am around 99% happy with it. Current
I have this page that i have a rotate slideshow running. I have it
i have this function that starts a slideshow automatically and i need to delay
I have blinking text modal dialog box and slideshow with jquery. They working just
The light box pops up, but doesn't load the image. I have hacked this

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.