0

I need to redirect users to a different page after 12 seconds,but only one time. By means if they back to the previous page they will not be redirected. I am trying to use cookies in this like this :

    <script type='text/javascript'>

    $(document).ready(function(){

    if($.cookie('Visited') != 'yes'){

    $.cookie('Visited', 'yes', { path: '/', expires: 1 });

     window.location.href = "http://www.example.com/";

     }
    });
    </script>
  • you can check this awnsers. I hope it's you. http://stackoverflow.com/questions/35397732/run-jquery-code-only-the-first-time-a-user-visits-the-website – Masud Rana Oct 19 '16 at 16:44
  • thank you,but localStore works only with html5 I guess? – user3438908 Oct 19 '16 at 17:08
  • window.localStorage - stores data with no expiration date window.sessionStorage - stores data for one session (data is lost when the browser tab is closed) both can not help me coz I need to redirect to another page once for a specific time set in cookies expiration one day for example – user3438908 Oct 19 '16 at 17:16

0 Answers0