You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am developing an application which have both laravel and node app. I need to get laravel session in my node app. So I thought of using your module. But I am not getting the session when i debugged i am getting an error as follows:
0|index | You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
0|index | SyntaxError: Unknown / Unhandled data type(s): =
0|index | at error (/var/www/html/moments.digitaljeevi.com/node_modules/php-unserialize/php-unserialize.js:54:13)
0|index | at _unserialize (/var/www/html/moments.digitaljeevi.com/node_modules/php-unserialize/php-unserialize.js:166:11)
0|index | at unserialize (/var/www/html/moments.digitaljeevi.com/node_modules/php-unserialize/php-unserialize.js:173:10)
0|index | at Object.module.exports.getSessionKey (/var/www/html/moments.digitaljeevi.com/node_modules/node-laravel-session/index.js:48:16)
0|index | at /var/www/html/moments.digitaljeevi.com/helpers/data.js:28:52
0|index | at propagateAslWrapper (/usr/local/lib/node_modules/pm2/node_modules/async-listener/index.js:457:23)
0|index | at /usr/local/lib/node_modules/pm2/node_modules/async-listener/index.js:494:70
Is there any thing I am missing. I am writing my code here. Please help me in solving this issue.
use strict';
var config = require('config');
const cookie = require('cookie');
const laravelSession = require('node-laravel-session');
let redis = require('redis');
let redisCon = redis.createClient();
const ENV_PATH = config.get('API.core.env');
module.exports = {
getCustomerSession: function (request) {
laravelSession.getAppKey(ENV_PATH)
.then((appKey) => {
let session = cookie.parse(request.headers.cookie);
let sessionId = laravelSession.getSessionKey(session.laravel_session, appKey);
console.log(sessionId);
laravelSession.getSessionFromRedis(sessionId, redisCon).then((session) => {
console.log(JSON.stringify(session));
return JSON.stringify(session);
});
});
}
};
Here when i console first session variable i am getting a value as follows:
It seems to me that the session id is wrong, i would look at the parameters
you are passing to that function. If you see the session id you get looks
encrypted which should not be the case.
Hi,
I am developing an application which have both laravel and node app. I need to get laravel session in my node app. So I thought of using your module. But I am not getting the session when i debugged i am getting an error as follows:
Is there any thing I am missing. I am writing my code here. Please help me in solving this issue.
Here when i console first session variable i am getting a value as follows:
But after this no variable is returning any value. Please help me.
The text was updated successfully, but these errors were encountered: