Support the ongoing development of Laravel.io →
Input Session Validation
Last updated 2 years ago.
0

I have found the problem,which is i have this javascript which makes multiple requests to the server to check if the user is still logged in

 <script>
   (function worker() {
        $.ajax({
            url: '{{URL::route('check')}}',
            success: function(data) {
                if(data === 'false') {
                    window.location.href = '{{URL::route('login')}}'
                }else {
                    //success
                }
            },
            complete: function() {
                // Schedule the next request when the current one's complete
                setTimeout(worker, 200);
            }
        });
    })();
</script>

the requests cause session persistance to fail!! How do i fix this?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Malouda malouda Joined 11 Dec 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.