Welcome Guest, Not a member yet? Register   Sign In
persistent login
#1

(This post was last modified: 04-02-2016, 12:26 AM by rakibtg.)

How would you implement a persistent login in CI3?
No need to write code, please give me some pseudo ideas, would help me a lot :-)
I wanted to write a library that simple handle the persistent login issue. I dont want to use any third party auth system.

Thanks for your time and have a great day!
Reply
#2

Save a hashed cookie on the users system and check for it on login, if they have the cookie do a auto login method.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

one compromise that amazon does that i think is graceful. lets say you shop at amazon and put some stuff in the cart, but do not complete the purchase
then you come back two weeks later on the same computer and web browser. Amazon does not ask you to immediately log-in again - they read your cookie - and let you continue with your shopping session. BUT when it comes time to actually place the order - possibly with a credit card that is already on file with them - you have to log in (again).
Reply
#4

(This post was last modified: 04-04-2016, 01:27 AM by keulu.)

like insiteFX,

after a login, with option "remember me ?" write a cookie.

next time :
if you don't have cookie -> normal login
if you have cookie -> autologin

after a manual log out, remove the cookie...
Reply
#5

First off, realize that Remember Me functionality is very easy to hack if not implemented very carefully. Which is one good reason not to implement your own. However, even if you were to use someone else's you'd need to know what to look for to ensure it was secure, anyway. This article provides a pretty good look at what can go wrong and how to implement a pretty secure version of it.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB