# php any  help secure login

**URL:** <https://www.phphelp.com/t/php-any-help-secure-login/22151>\
**Category:** Security and PHP\
**Created:** [February 20, 2014, 4:33am UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151 "2014-02-20T04:33:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![infoitmanoj](https://www.phphelp.com/user_avatar/www.phphelp.com/infoitmanoj/32/1021_2.png) [@infoitmanoj](https://www.phphelp.com/u/infoitmanoj)\
**Post date:** [February 20, 2014, 4:33am UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151/1 "2014-02-20T04:33:08Z")

</div>

i am beginning for php …so any help for how to create easily secure login in php …

---

<div class="post-metadata">

**Author:** ![scottlpool2003](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@scottlpool2003](https://www.phphelp.com/u/scottlpool2003)\
**Post date:** [February 20, 2014, 12:45pm UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151/2 "2014-02-20T12:45:54Z")

</div>

Using PDO ([http://uk3.php.net/PDO](http://uk3.php.net/PDO))/MySQLi ([http://uk3.php.net/mysqli](http://uk3.php.net/mysqli)) along with password\_hash ([http://uk3.php.net/password\_hash](http://uk3.php.net/password_hash)) and password\_verify ([http://uk3.php.net/manual/en/function.password-verify.php](http://uk3.php.net/manual/en/function.password-verify.php)) should be sufficient for a basic login.

Give it a try, if you have any problems, post your code and we’ll help you out.

---

<div class="post-metadata">

**Author:** ![infoitmanoj](https://www.phphelp.com/user_avatar/www.phphelp.com/infoitmanoj/32/1021_2.png) [@infoitmanoj](https://www.phphelp.com/u/infoitmanoj)\
**Post date:** [February 21, 2014, 7:38am UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151/3 "2014-02-21T07:38:44Z")

</div>

Thanks dude ur help nd also pls any sample php login examples for secure login using sessions …

---

<div class="post-metadata">

**Author:** ![scottlpool2003](https://www.phphelp.com/letter_avatar_proxy/v4/letter/s/71e660/32.png) [@scottlpool2003](https://www.phphelp.com/u/scottlpool2003)\
**Post date:** [February 21, 2014, 10:19am UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151/4 "2014-02-21T10:19:03Z")

</div>

We’re not going to write code for you. Give it a go yourself and then ask for help.

As for sessions, set the session if the user is authenticated. There are lots of things you can set in the session, but I just use a user\_id as it doesn’t hold any usable data. I then pull out the users information as-and-when.

More advanced systems may use different methods such as storing data in memcash, but I haven’t had the need for anything like that as of yet.

---

<div class="post-metadata">

**Author:** ![JimL](https://www.phphelp.com/user_avatar/www.phphelp.com/jiml/32/1842_2.png) [@JimL](https://www.phphelp.com/u/JimL)\
**Post date:** [February 21, 2014, 11:25am UTC](https://www.phphelp.com/t/php-any-help-secure-login/22151/5 "2014-02-21T11:25:55Z")

</div>

> [@scottlpool2003](#):
>
> More advanced systems may use different methods such as storing data in memcash, but I haven’t had the need for anything like that as of yet.

You can actually just set up php.ini to store sessions directly in memcache, then you have a distributed memory based session handler for multiple servers 🙂
