jeudi 24 décembre 2015

updating file based session with angularJS GET request

I a having a really wield issue.

While sending a get request to save a session with angularJS

    $http({ method: 'GET', url: '/test-location'})
        .then(function successCallback(response) {
                // session was supposed to be saved
            }, function errorCallback(response) {
                console.log('error getting session');
            });

My PHP: (Laravel v-5.1)

Session::put($key, $data);
Session::save();
print_r(Session::get($key));
die;

I am always getting the desired output to screen. however the session is not always being saved. ( sometimes is )

If i go in my browser to the page that the session is supposed to save at ( http://ift.tt/1kiif1r ) it always saves the session and there is never any issue.

I always get COOKIE response from the ajax request.

Does anyone have any idea what is going on?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire