Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > store in session View modes: 
User avatar
Member
Member
maggie.nu-gmail - 8/2/2011 8:00:31 AM
   
store in session
i have a custom login to extrenal database

beside username and password i have also field to validate
i tried to save the variable session["field']= "0000";
but i cannot retrive in
custom security handler..
how can i retrive this var (Session["field"] not working )

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 8/2/2011 8:58:53 AM
   
RE:store in session
Hello,


you can use these API methods to get and set the session variables:

CMS.GlobalHelper.SessionHelper.SetValue("<key name>", "<value>")
CMS.GlobalHelper.SessionHelper.GetValue("<key name>")


Best regards,
Helena Grulichova

User avatar
Member
Member
maggie.nu-gmail - 8/2/2011 9:05:20 AM
   
RE:store in session
its not working for me here is my code :
void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
{
CMS.GlobalHelper.SessionHelper.SetValue("Code", "lalalal");
}

public override object OnAuthentication(object userInfo, string username, string password)
{
string x = CMS.GlobalHelper.SessionHelper.SetValue("Code"); //THIS RETURNS NOTHING
}

User avatar
Member
Member
maggie.nu-gmail - 8/2/2011 9:15:32 AM
   
RE:store in session
Sorry

public override object OnAuthentication(object userInfo, string username, string password)
{
string x = CMS.GlobalHelper.SessionHelper.GetValue("Code"); //THIS RETURNS Null
}

User avatar
Member
Member
maggie.nu-gmail - 8/2/2011 9:22:24 AM
   
RE:store in session
my bad , Code was in capital