By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,887 Members | 1,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,887 IT Pros & Developers. It's quick & easy.

setting session timeout through .htaccess

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.