473,408 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

setting session timeout through .htaccess

Hello

I need people to be able to complete long text blocks in my cms before
their session times out. From the php documentation I gather that ini
directive session.gc_maxlifetime would be the one to adjust here.

I am on shared hosting, so I can't change the php_ini settings directly.
If I use ini_set, should I do that on every page in my cms, or would it
suffice to do it on the login page? Or could I do it in a .htaccess file
(which my host permits)?

thanks!

..han
Nov 22 '05 #1
6 16405
On Sat, 12 Nov 2005 12:07:27 +0100, somaboy mx <no****@fakemail.fk>
wrote:
Hello

I need people to be able to complete long text blocks in my cms before
their session times out. From the php documentation I gather that ini
directive session.gc_maxlifetime would be the one to adjust here.

I am on shared hosting, so I can't change the php_ini settings directly.
If I use ini_set, should I do that on every page in my cms, or would it
suffice to do it on the login page? Or could I do it in a .htaccess file
(which my host permits)?


Not sure what a cms is but, If I understand you correctly you are
asking people to type in a lot of text on-line?

This is not good practice generally since there may be some other
break in connection and they will lose their work.

Could you not encourage them to use a text editor or WP and then cut &
paste their text in (just as I have done with this message).

Sorry if I have missed the point of this and got it wrong.

--
John

Nov 22 '05 #2
John wrote:
Could you not encourage them to use a text editor or WP and then cut &
paste their text in (just as I have done with this message).


I do. But the reality is that sometimes people get up and go make some
coffee, or go to the john or whatever while they're in the middle of
something. By the time they get back they try to submit the form, and
all of their changes are lost. That's the kind of situation I'd like to
deal with :)

..soma
Nov 22 '05 #3
On Sat, 12 Nov 2005 12:07:27 +0100, somaboy mx <no****@fakemail.fk> wrote:
I need people to be able to complete long text blocks in my cms before
their session times out. From the php documentation I gather that ini
directive session.gc_maxlifetime would be the one to adjust here.

I am on shared hosting, so I can't change the php_ini settings directly.
If I use ini_set, should I do that on every page in my cms, or would it
suffice to do it on the login page? Or could I do it in a .htaccess file
(which my host permits)?


It's got to be done throughout the site, setting it on the login page isn't
enough. .htaccess is a convenient place to do it. ini_set would work if you
have a central inclue file that's included from all the other pages.

Just increasing the session timeouts in .htaccess on shared hosting may not
work as expected - you probably need to set a separate session directory as
well.

See:
http://groups.google.co.uk/group/com...eaa0acb60fb33c
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 22 '05 #4
On Sat, 12 Nov 2005 12:44:22 +0100, somaboy mx <no****@fakemail.fk>
wrote:
John wrote:
Could you not encourage them to use a text editor or WP and then cut &
paste their text in (just as I have done with this message).


I do. But the reality is that sometimes people get up and go make some
coffee, or go to the john or whatever while they're in the middle of
something. By the time they get back they try to submit the form, and
all of their changes are lost. That's the kind of situation I'd like to
deal with :)


That's precisely why you need to minimize the time spent completing
the form in online with a good design for the page.

Must say I don't ever remember going to the toilet half way through a
filling a form.

--
John
Nov 22 '05 #5
On 2005-11-12 07:36:59 -0500, Andy Hassall <an**@andyh.co.uk> said:
On Sat, 12 Nov 2005 12:07:27 +0100, somaboy mx <no****@fakemail.fk> wrote:
I need people to be able to complete long text blocks in my cms before
their session times out. From the php documentation I gather that ini
directive session.gc_maxlifetime would be the one to adjust here.


Forgive me If I am missing something but do PHP sessions not live for
the life of the browser?
In all of my sessions work with PHP (which has been limited) the
session identifier cookie is set automatically by PHP with an expiry
time of the life of the browser... so until someone quits IE or Firefox
or whatever... their cookie is alive... therefore when they try to
access the session data again, as long as they didn't quit their
browser before going to the john.... then their form would work as
expected when they return.

Perhas we are talking about different concepts?
(This is more of a question than a helpful response, I would like to
understand.)

-Ci

Nov 22 '05 #6
On Sun, 13 Nov 2005 19:49:41 GMT, Ciphex .? <ci****@mac.com> wrote:
Forgive me If I am missing something but do PHP sessions not live for
the life of the browser?
In all of my sessions work with PHP (which has been limited) the
session identifier cookie is set automatically by PHP with an expiry
time of the life of the browser... so until someone quits IE or Firefox
or whatever... their cookie is alive... therefore when they try to
access the session data again, as long as they didn't quit their
browser before going to the john.... then their form would work as
expected when they return.


The cookie may be a browser-session cookie (by default) with no timeout, but
PHP has its own timeout after which the session data is subject to deletion.
(There's nothing to stop someone opening a browser, starting a session and
keeping that browser open for a year...)

Since there is no way for PHP to know when a user has closed their browser,
PHP must have a way of expiring the session data from the server.

Also, the session cookie doesn't have to be a browser-session cookie anyway,
it can be a normal cookie with a specific timeout.
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Nov 22 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AmigaLemming | last post by:
As I understand my admins installed a PHP server and now my plain HTML pages also want to set a PHPSESSID cookie when loaded into a browser. Can I suppress this, e.g. by creating a configuration...
4
by: yohomonkey | last post by:
I want to setting the session end , but ican't waiting for the session is timeout! Who can help me?
2
by: Ric Pullen | last post by:
Hi, i've been playing around with the session time out setting in the webconfig. Now i set it at 1 minute and waited in the global.asx in the session end event but it does not fire. What i'm...
1
by: Scott Walters | last post by:
Hi, I have an asp.net webapp that uses some javascript in a hidden frame on the browser to poll the server every 30 seconds, using an http post. I also want my sessions to timeout in the...
1
by: Ken Varn | last post by:
IIS has a Session Timeout setting. How does this setting coincide with the ASP.NET property Session.SessionTimeout value. If I change this value in code, will it override the IIS Session Timeout...
2
by: Siegfried Heintze | last post by:
I have edited my web.config file in an attempt to prolong the amount of time my browser can site idle: <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"...
4
by: UJ | last post by:
I have a page where the user can upload a video file. As you can guess, this may take a while. Is there a way I can change the session timeout for just this one page? I would also want to change...
1
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
2
sumittyagi
by: sumittyagi | last post by:
I am using websphere 5.1 and I want to set session timeout for my application. Now I know two ways of setting it (declaratively and programmatically). * declaratively in web.xml of the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.