I am new to mean stack , in fact working on my very first project , i want to remember the request from the specific browser , which i have done using cookies . After that i want to send the history data from the server specific to every request which i am not able to do , as i couldnt find a suitable way . i tried using sessionstorage in angular js but that doesnt pull the session data i kept in node js ) Please let me know how is make it .
Node js: when i have set session var titles here in node js
var chkck = function(req,res,next){
console.log("inside cookie callback .. ");
req.session.titles = req.session.titles || [];
//titles.push(req.params.)
req.session.titles.push("22");
res.sendFile("F:/customer/public/index.html");
}
app.use(chkck);
app.get('/',function(req,res){
res.sendFile("F:/customer/public/index.html");});
angular js: but in angular , i am not able to retrieve the titles from sessionstorage .
var nameapp=angular.module('name-App',["ngRoute",'ngCookies','ngStorage']);
nameapp.controller('NameCtrl',
function($scope,$http,$window, $cookieStore,$sessionStorage ){
$scope.arr=[];
$scope.finddet=function(){
console.log("sessionstorage.titles"+ $sessionStorage.titles);
}});
this gives undefined