Posts: 47
Threads: 18
Joined: Jan 2015
Reputation:
0
04-02-2016, 12:21 AM
(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!
Posts: 4,435
Threads: 102
Joined: Oct 2014
Reputation:
146
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 )
Posts: 360
Threads: 13
Joined: Nov 2014
Reputation:
17
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).
Posts: 82
Threads: 8
Joined: Feb 2015
Reputation:
4
04-04-2016, 01:26 AM
(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...