Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9094669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:24:15+00:00 2026-06-16T23:24:15+00:00

I’m using cakephp 2 together with the AuthComponent to authenticate users on my webapplication.

  • 0

I’m using cakephp 2 together with the AuthComponent to authenticate users on my webapplication. It is crucial that users do NOT get logged out automatically for a very long time (at least 24 hours, longer or infinitely would be best). The reason is that we store a number of things in the the cakephp webapp that have to be available to the currently signed in users within seconds without forcing him to type in his password. For this reason I already set Security.level to low and I also implemented

Configure::write('Session.timeout', 3000);

which ought to give the user a good two days before he gets logged out. Yet from time to time a user still gets logged out, even if he has been active within the same minute already. I don’t really know when it’s happening and how to reproduce it but I wondered if I might have missed something and would other strategies might help to solve my issue.

As a webserver I’m using standard apache on Ubuntu 12.04 without any special configuration changes!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:24:17+00:00Added an answer on June 16, 2026 at 11:24 pm

    To allow this to work effectively you will do this in two parts. I can’t speak specifically to the component you are using, but I can provide a general theory of operation.

    PHP sessions should never be considered something that will last long. They will be active while the user is on the site, but eventually cleaned up. So how do you get the user session to “never expire” ?

    When the user logs in, you will create a unique one time hash. This hash will be stored by the user as a cookie, and you should also reference it in your database (to the user that the hash is associated with)

    This hash provides an alternative login path. If the user returns to the site and has no session, instead of directing the to the login page, you see if the user has the cookie. If they do, you can log them back in.

    Now its important to only allow that hash to be used once. After the hash is used to create a session, you need to generate a new one and update the cookie and database with the new hash.

    Some things to keep in mind:

    • The hash should be unique and generated with random data. It should
      not be something that can be easily forged.
    • If the user access your site with multiple devices, its possible each device will have its own unique hash, keep that in mind with
      database design.
    • Its a good idea to use SSL so that the hash cannot be easily sniffed.
    • The hash should expire in a certain amount of time so that an old hash cannot be used to login to the site.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I need a function that will clean a strings' special characters. I do NOT
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am using JSon response to parse title,date content and thumbnail images and place
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.