• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to setup login and logout using codeigniter ?

[eluser]Kiran cet[/eluser]
I just setup login using session libraries. But i want to disable backward button of browser after i logged in and also logged out. What is the best method to do that ?


One thing I've learned by working on Community Auth is that if you are asking these questions, you are much better off using somebody else's authentication. At this point I've put hundreds of hours into Community Auth, and I keep working and working on it. It doesn't seem like it will ever end. Just when I think everything is good, I read an article on authentication that gives me an idea or makes me aware of a security vulnerability, and it's back to work.

There is my Community Auth, but also Ion Auth, Tank Auth, DX Auth, AG Auth, and more. If you insist on making your own, take a look at these, because they will point you in the right direction, not only for login/logout, but also for best practices for password security, cookie security, etc etc.

Take a look at this:

That page on stack overflow will cover a lot of all the things you need to be aware of before writing any code.

There is no "good" method for doing it. You either have to prevent the browser from caching the page at all (which even that is not fool proof), or you can use Javascript to make an additional verification request upon page load to check the session (which is both extra work [slower] and easily disabled by turning Javascript off).

Unless it is highly highly sensitive information, the best thing is to just encourage the user to close their browser to erase the cache.

And read that SO page for lots of good stuff.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.