LiquidPlanner Classic Forum

Ask a Question
Back to All

trying to figure out if a user has a session started.

Posted on behalf of a customer. Original posting date 2015-01-08.

Customer asked:

Trying to have my own login page. I don't know how to figure out if a user has a session started. When session is not started browser listens to HTTP 401 and puts its Auth Dialog up which work, but I want to use my own.

How to see when user is already logged in and display my own if not?

LP Support responded:

I talked to our dev team and unfortunately, there's no great foolproof way to do this. They said you can try making a request to: "https://app.liquidplanner.com" and look at the response. If it's a 302 (a redirect), then that means the user is already logged in. If not, then the user is not logged in. If it's redirecting to /login then the user is not logged in.

If you're trying to piggy-back on the user session to make API calls - that isn't possible.

Follow-up question from customer:

I am using Javascript and can't figure out how to tell if I get a 302 response.