Answers.Body: <p>If you're trying to create a front-end login form, I'd suggest using this as a starting point: <a href="https://docs.craftcms.com/v3/dev/examples/login-form.html" rel="nofollow noreferrer">https://docs.craftcms.com/v3/dev/examples/login-form.html</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-19T06:39:56.867Z
Answers.Text: I want to add a login for users of the site, not for the admin section, that link is for the admin section right?, I deleted the tutorial I put in the question as it was apparently really bad code, I followed a better tutorial that works perfectly but just trying to convert $_SESSION to Twigs session object now, not really sure how to do it.
Answers.UserDisplayName: JTR
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-19T18:59:43.683Z
Answers.Text: A user is a user in Craft and they either have permissions to access the Control Panel or they don't.  So the link above allows you to create a login form on the front-end of the site so they'll have a valid PHP/Craft session.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-20T02:50:32.417Z
Answers.Text: If what I'm thinking is right then I just waisted a lot of time haha, so what you're saying is all I have to do is create a user in the Craft CMS settings section and then put that code in my front-end and, then I can apply twig to display certain things on my craft templates to those users so "Welcome, {{ session.username }}"? I thought that login form was a front-end method of reaching the CMS, if it isn't then that sounds exactly like what I want.
Answers.UserDisplayName: JTR
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-20T12:38:00.087Z
Answers.Text: Also this seems only possible with Craft Pro, but I guess I'm just going to have to get that.
Answers.UserDisplayName: JTR
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-12T12:00:41.560Z
Answers.Text: Yes this is correct – you can use Craft to login users on the front end so they will never see the control panel. Yes you will need pro for multiple user support.
Answers.UserDisplayName: dmatthams
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-07-18T23:23:16.157Z
Answers.LastActivityDate: 2019-07-18T23:23:16.157Z
Answers.UserDisplayName: Brad Bell
Body: <p>I'm trying to implement <a href="https://www.codeofaninja.com/2013/03/php-login-script.html" rel="nofollow noreferrer">this</a> tutorial in my Craft CMS site, I've created all the files and they currently reside in public_html, but twig and the .htaccess of Craft CMS is interfering with it.</p>
  
  <p>Does anyone know what the directory structure should look like to integrate this with craft cms or whether it's possible by other methods?</p>
  
  <p>Appreciate any help.</p>
  
Tags: <users><php><login>
Title: PHP Login & Sessions without Craft Commerce?
ThreadText: # PHP Login & Sessions without Craft Commerce?
  
  (Asked by: username_0 on 2019-07-17)
  
  I'm trying to implement [this](https://www.codeofaninja.com/2013/03/php-login-script.html) tutorial in my Craft CMS site, I've created all the files and they currently reside in public\_html, but twig and the .htaccess of Craft CMS is interfering with it.
  
  Does anyone know what the directory structure should look like to integrate this with craft cms or whether it's possible by other methods?
  
  Appreciate any help.
  
  **Tags:** users, php, login
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-07-18. Score: 1
  
  If you're trying to create a front-end login form, I'd suggest using this as a starting point: <https://docs.craftcms.com/v3/dev/examples/login-form.html>
  
  > **Comments:**
  > **username_0**: I want to add a login for users of the site, not for the admin section, that link is for the admin section right?, I deleted the tutorial I put in the question as it was apparently really bad code, I followed a better tutorial that works perfectly but just trying to convert $_SESSION to Twigs session object now, not really sure how to do it.  
  > **username_1**: A user is a user in Craft and they either have permissions to access the Control Panel or they don't.  So the link above allows you to create a login form on the front-end of the site so they'll have a valid PHP/Craft session.  
  > **username_0**: If what I'm thinking is right then I just waisted a lot of time haha, so what you're saying is all I have to do is create a user in the Craft CMS settings section and then put that code in my front-end and, then I can apply twig to display certain things on my craft templates to those users so "Welcome, {{ session.username }}"? I thought that login form was a front-end method of reaching the CMS, if it isn't then that sounds exactly like what I want.  
  > **username_0**: Also this seems only possible with Craft Pro, but I guess I'm just going to have to get that.  
  > **username_2**: Yes this is correct – you can use Craft to login users on the front end so they will never see the control panel. Yes you will need pro for multiple user support.  
  
  ---
  
  