Howdy, Stranger!

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


How to make Remember Me for long time for our site
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to make Remember Me for long time for our site

How to make Remember Me for long time for our site like facebook.com ? Our site doesn't have Remember Me option in login page.. when logging in, but are forced to log in again when the browser sessions closes.

Comments

  • Save the password in the browser?

    Thanked by 12014
  • BochiBochi Member

    Cookies?!

    Thanked by 12014
  • nexusrainnexusrain Member
    edited July 2015

    What about smth like

    <?php setcookie("login", $session_id, strtotime( '+30 days' )); ?>

    ?

    Thanked by 12014
  • 20142014 Member

    @HostMyBytes said:
    Save the password in the browser?

    Yes... Save password not working.. also not coming save message..

  • 20142014 Member

    @Bochi said:
    Cookies?!

    i don't know what.. tell me anything for make it :)

  • 20142014 Member

    @nexusrain said:
    What about smth like

    <?php setcookie("login", $session_id, strtotime( '+30 days' )); ?>

    Where i need to add this code? Login page?

  • BochiBochi Member

    Of course you should adapt this for your use case, especially in terms of security...
    But the code you were given here has to find its place after a user is successfully authenticated.

  • 20142014 Member

    @Bochi said:
    Of course you should adapt this for your use case, especially in terms of security...
    But the code you were given here has to find its place after a user is successfully authenticated.

    Thanks, im use cloudflare for our site.. thats effect to login ?

  • BochiBochi Member

    Sorry, but I don't understand what you mean...

  • 20142014 Member

    sorry :( i mean, cloudflare DNS effect to password saving or login season ?

  • 2014 said: cloudflare DNS effect to password saving or login season ?

    No. Not at all. Seems like you haven't set any cookies.

  • BochiBochi Member

    You mean if your setup involving Cloudflare influences the implementation of cookies into your sites software? Then nope, it shouldn't...

  • @2014 said:

    Exactly. Let the server create a session id and save it as a cookie on the clients device. Further, request the cookie with every action done on the site so the server can check if a client is logged in peroperly. Here's an explanation of the code I wrote:

    setcookie - functions name
    "login" - a name for the cookie
    $session_id - the content of the cookie
    strtotime - function
    +30 days - how long the cookie is valid until it expires

    Thanked by 12014
  • Who made your website? What is it built with? Are you using a CMS?

  • 20142014 Member

    @Chronic said:
    Who made your website? What is it built with? Are you using a CMS?

    here is main script we are using - http://codecanyon.net/item/photofans-your-social-network-to-share-photos/6308014

    But now we have changes design :)

  • 20142014 Member

    @nexusrain Thank you for help..

  • @Bochi said:
    Cookies?!

    Hmmm cookies... Give me some! (With chocolate chips/chuncks if possible)

Sign In or Register to comment.