Developer forum

Forum » Development » Set user session as loged in

Set user session as loged in

Tom-Erik Paulsen
Reply

Hi!

We have made a script that checks an API if the user is a paying member, and if the user is valid, we create the user on the fly in the database ( AccessUser )
But the problem our developer has, is how to set the user as loged in via our custom .aspx page.

How do we set av valid user as logged in in the session variables? We are mainly after what the session name is, and what the value should be for the user.

IE:

HttpContext.Current.Session("DW_extranet_groups") = " groups "
HttpContext.Current.Session("DW_extranet_username") = " username "
HttpContext.Current.Session("DW_extranet_AccessUserUserName") = " userusername"

 

 


 


Replies

 
Vladimir
Reply

Hi Tom-Erik,

mmm.. may be it would be more correct to use API:

Dynamicweb.Security sec = new Security(); 
sec.ExtranetLogin(username, password); 

Best regards,

Vladimir

 

 

 

 
Tom-Erik Paulsen
Reply

Thanks a lot for the reply Vladimir ;-)

What do I do to include tha library? ( name / location / dll )
I does not seem to be loaded by default in the webserver.

Thanks ;-)

 

 
Vladimir
Reply

It's our core library - dynamicweb.dll

Best regards,

Vladimir

 
Tom-Erik Paulsen
Reply

 

 

 
Tom-Erik Paulsen
Reply

But I do need to know where the dll file are? In order to call it? I do not have access to that area, only ftp to files. Our script is a regular .aspx file called upon by a script.

 
Nicolai Høeg Pedersen
Reply

If you are editing a .aspx file (or Dynamicweb Razor) you can just call the code as it is already loaded in the app-domain.

BR Nicolai

 
Tom-Erik Paulsen
Reply

That was my thougs allso, but we end up with: ( see attachement )

 

Screenshot_2015-11-17_12-52-50.png
 
Vladimir
Reply
This post has been marked as an answer

Hi guys,

I'm very sorry, it should be
Dynamicweb.Security sec = new Dynamicweb.Security();
of course

Best regards,

Vladimir

Votes for this answer: 1
 
Tom-Erik Paulsen
Reply

Hey guys!

This worked perfectly! I'm no C# guy, but we got it to work eventually, thanks to you both!

 

You must be logged in to post in the forum