Login programtically and transfer to other module page

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
1/25/2011 11:43:20 AM
Gravatar
Total Posts 39
Hello from France!

Login programtically and transfer to other module page

Hello


I need a page to register a new user (mymodule \ Page1.aspx) with custom fields, followed by a page to pay a subscription with paypal (mymodule \ Page2.aspx).
In page1.ButonOK_Click (), I have :
If MyCustomControlValues then          ' Retrieve and test the controls values
  siteUser = New SiteUser (Sitesettings)
  siteUser.Name = myName
  siteUser.LoginName = myLoginName
  siteUser.Email mymail =
  siteUser.Password = myPwd
  siteUser.Save ()

  ret = siteUser.Login (Sitesettings, mymail, myPwd)
  Response.Redirect ("Page2.aspx)

Endif

When I run the site, Page1 work fine, create a record in mp_Users and mp_UserRoles and redirecte to (module)Page2.aspx

But In page2, the folowing code return false:

If Request.IsAuthenticated then ...

Forgot something?
Thank you for your help

 

1/25/2011 11:57:48 AM
Gravatar
Total Posts 18439

Re: Login programtically and transfer to other module page

bool persistentCookie = false;

if (siteSettings.UseEmailForLogin)
{
FormsAuthentication.SetAuthCookie(siteUser.Email, persistentCookie);
}
else
{
FormsAuthentication.SetAuthCookie(siteUser.LoginName, persistentCookie);
}

Hope it helps,

Joe

1/25/2011 1:35:02 PM
Gravatar
Total Posts 39
Hello from France!

Re: Login programtically and transfer to other module page

Thank you, thank you, thank you
I was looking for the solution for 4 days!
I bought you a beer.
 

As we say in France: tchin tchin

Christian
 

1/25/2011 1:36:55 PM
Gravatar
Total Posts 18439

Re: Login programtically and transfer to other module page

Glad to be of help and thanks for the beer! Much appreciated.

Cheers,

Joe

You must sign in to post in the forums. This thread is closed to new posts.