Developer forum

Forum » Development » ExtranetLogin randomly getting logged out

ExtranetLogin randomly getting logged out

Henning Jensen
Reply

Hi.

After using the API call (Dynamicweb.Security ExtranetLogin(string, string)) to log in, some users get logged out at random times.

We are using a custom notification subscriber that logs the browser into a special account if the parameters are correct, not the module.

 

I have noticed that if im logged in with another user before i use the API to log in it resets, after som time, back to the first account.

 

Are we missing a call or using the wrong one ?

 

var sec = new Dynamicweb.Security();

sec.ExtranetLogin(user.UserName, secretPassword);

 

 

Thanks

Henning


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Henning

It looks right - we do the exact same thing...

Logout only happens if the session resets.

When you login using a form, it might submit some additional parameters like save username and password. So if your custom login times out, the login will fall back to the saved username and password. I think that must be it.

Votes for this answer: 1
 
Henning Jensen
Reply

Thanks Nicolai, that seems probable.

I dont really know what my options are, should i save the login info for the custom thing in a cookie and read it in the pageloaded subscriber to log them in again?

 

 
Nicolai Pedersen
Reply

That is my best bet - if that is your desired behavior - set a validation timespan on the cookie that makes sense.

 

You must be logged in to post in the forum