Questions tagged session

Explore the latest questions and answers asked by our top developers.

Can I use passport and sessions with Angular? I can log in, but Passport’s "isAuthenticated()" always returns false

I am using Angular, Passport and sessions for authentication. I can create a new user, login but, Problem when checking if the user is logged using Passport’s isAuthenticated() function always returns false. I followed the instructions from various online resources and I am unsure if: Question I can use passport and sessions with my Angular […]

By Alex
Categorized as angular, javascript, node.js, passport.js, session Tagged , , , ,

Javascript: how to keep Solace the session alive

I have a website the use Angular and a Solace system that manage the communication between the Front-end and Back-end site. Here my configuration for it: As you can see, the keepAliveIntervalInMsecs is 30000ms and keepAliveIntervalsLimit is 100. That’s total 3000s. But if I pause the browser with a breakpoint for debugging for 30s, the […]

By L Quang B o
Categorized as angular, javascript, session, solace Tagged , , ,

Cookie available in HttpHeaders but not in Application

My Express session is – secret: ‘secret’, resave: false, saveUninitialized: false, cookie:{ maxAge:600000, httpOnly:false, secure:false, SameSite:"None" } })) CORS details are – // CORS enabled app.use(function(req, res, next) { res.header("Access-Control-Allow-Origin", "http://localhost:4200,"); // update to match the domain you will make the request from res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); res.header("Access-Control-Allow-Credentials", true); next(); }); app.use(cors({ origin:[‘http://localhost:4200′,’’], […]

By lobit
Categorized as angular, cookies, express, node.js, session Tagged , , , ,

How to get session from Ory Kratos in Angular?

I have not too much experience with Angular and generally web development so this topic is a little bit problematic for me. I am trying to get a session from kratos to authorize an user but I still get some errors. There is my code: this.kratos .toSession(undefined, ‘Cookie’) .then(({ data: session }) => { // […]

By kasa4565
Categorized as angular, cookies, session, typescript Tagged , , ,

How to share session variables between PHP and Angular

Hello we have our old login system in PHP, But on new sub domain we made application with angular and we want to share login with each other, we want user will login on our subdomain and then will be redirected to angular app, So we want to share varibles between both apps like username,id,full […]

By Farhan Akhtar
Categorized as angular, local-storage, mysql, php, session Tagged , , , ,

Angular user logged in and session lost – how to check and redirect?

What happens when a user is logged in but the session has gone stale? In this situation I lose, for example, my users name from the session so name displays as "null". So I need to redirect back to login right? So in my app-routing.module.ts, I have { path: ‘**’, redirectTo: ” } at the […]

By Ree
Categorized as angular, routes, session Tagged , ,

Angular 2+ -> session based authentication vs jwt authentication

If we are building new Angular application with authentication mechanism what is the recommended way to authenticate the user? I’ve seen a lot of Angular authentication tutorials and all of them are showing only jwt authentication approach. Is there a way to implement session-based authentication in Angular Applications along with some custom backend? Should we […]

how to load a page on session expiry

net framework on backend and angluar 4 on front end. I have added session state tag in web.config to expires the session. Now my problem is after adding this tag in web.config my session is successfully expired and user is redirected to login.aspx which return an html page index.html but html page is not loading, […]

By user388231
Categorized as angular,, session Tagged , ,

How does the .net core 5 Web Api session work with Angular?

I have 2 web api, one is set the session when angular call HTTP get method, and want to retrieve the session value in HTTP post method. I have done some research need to setup session in startup.cs, below is my startup code: services.AddDistributedMemoryCache(); services.AddSession(options => { options.IdleTimeout = TimeSpan.FromMinutes(10); options.Cookie.HttpOnly = true; options.Cookie.IsEssential = […]

By Eric Eng
Categorized as angular,, session Tagged , ,

How know if I closing one tab, the last tab or the browser in Angular

The problem is the following: I want clear my localStorage when I close the last tab open or when I close the browser… the problem if there is not a close event so the method avaibles are onload and onbeforeunload and when you reload the browser this method are fired so how i can do […]

1 3

Still Have Questions?

Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us