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 8674851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:48:23+00:00 2026-06-12T19:48:23+00:00

I m building an app called Trackosaur which tracks time on things you do.

  • 0

I m building an app called Trackosaur which tracks time on things you do. I m using Cake2+jQuery1.8 for this. The issue I m facing is related to sessions getting timed out. I could adjust the time that a session times out through the php ini. But I need to ‘keep alive’ a session for really long durations (10+ hours). So I setup a ajax call to a trivial function in my UserController which just uses session_start() in it.

JS

function keepAlive()
{
        $.ajax({
            type: 'get',
            url: '/users/keepalive'
        }).done(function(data){});
}

CAKE

public function keepalive()
{
    session_start();
}

The ajax call is made every 10 minutes. I m not really sure if this is a good way to keep the session alive. Is there a better way I could do this using something in Cake itself as opposed to using session_start?

Many thanks for your time 🙂

  • 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-12T19:48:24+00:00Added an answer on June 12, 2026 at 7:48 pm

    In your core config file you can change the session timeout value.

    In CakePHP 1.3 it’s easy. Just find this and change to your value (36000 for 10 hours).

    app/config/core.php

    /**
     * Session time out time (in seconds).
     * Actual value depends on 'Security.level' setting.
     */
    Configure::write('Session.timeout', '120');
    

    In CakePHP 2, find this line and read the comment block above it for an explanation of how to configure the session time. I have not had to do this myself but I think:

    Configure::write('Session', array(
        'defaults' => 'php',
        'Session.timeout' => 36000
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently building an app that runs on mobile phones not related to the issue
I'm building a Facebook app called Lovers , using a Sinatra app on Heroku
HI, using vs2008 and building a web app. On a asp page called blackjack.aspx,
I'm building an iPhone app which gets updates from the web at regular time
I'm building a backbone app using backbone-relational models (but that shouldn't matter for this
I am building an app using ASP.NET 4.0. I have a table called entries.
I'm building a login system within my app that will be called several times.
Im building an app which uses Sqlite DB. Users can enter their information into
I'm building an app in Backbone using Node as the backend. As part of
I'm building an app that notifies user when new ThreadedComments appear. For this I'm

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.