Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Auth -> changing email address
  • Hello!


    Could you give an advice.
    I am making profile page, where user can changes his name, email address and pwd.
    if user changes pwd and name - no any issues. But if he changes email address after saving controller redirects to login page, because in cookie fuelcid email is old, and in DB email address is new. How to make possibility to change email address without logout?

    I am already tried to use Auth::create_login_hash(); -> nothing.
  • HarroHarro
    Accepted Answer
    The Auth drivers only store the username used to login, and the login hash. If you change that, it's obvious that the login session is no longer valid.

    You can call force_login() using the users' id after the change to re-login with the new username (= email in your case).
  • Thank you!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion