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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:08:53+00:00 2026-05-22T22:08:53+00:00

I am wondering whether we can declare session.gc_maxlifetime setting in .htaccess for the one

  • 0

I am wondering whether we can declare session.gc_maxlifetime setting in .htaccess for the one particular project instead of whole web server?

If so, how can we do that? Like the following code?

php_value session.gc_maxlifetime 2000

I’ve tried it and it didn’t work and also I created a php.ini file in the same directory of my project and it didn’t work either.

Thanks.

  • 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-05-22T22:08:54+00:00Added an answer on May 22, 2026 at 10:08 pm

    Yes, session.gc_maxlifetime is a PHP_INI_ALL setting so it can be overidden in .htaccess:

    php_value session.gc_maxlifetime 2000
    

    Also make sure that <Directory> entry in your Apache configuration supports override:

    AllowOverride Options
    

    It also may be possible that you misunderstood the purpose of this option. This option will not set the maximum life time of a session, it will set the amount of time after which the garbage collector will clean the session if it’s not valid. This can be determined by a lot of factors, including access times, modification times, other INI options such as session.gc_probability and session.gc_divisor.

    If you want to limit a session life time, use a proper mechanism for that, as described by @Gumbo in How do I expire a PHP session after 30 minutes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm now wondering whether we can make some sort of SSL server based on
i was wondering whether i can add Aspect J to a Maven project because
I was wondering whether there is a tool available that one can use to
I was wondering whether (and how) one can create empty c type arrays in
I am wondering whether I can use the this keyword inside a C# lambda,
I am wondering whether I can upgrade a basic IoC container I am using
I'm learning the Google Maps API and I was wondering whether I can use
I was wondering whether or not I can extend the Enum type in C#
Just wondering is there any way I can check whether the url links to
I am using SQL Server 2008 Enterprise. I am wondering whether dead lock issue

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.