0

Dear
I would like to set session expire time to 3hrs,
Which one is best ?
ini_set("session.cookie_lifetime","10800"); or session_set_cookie_params(3600 * 3);
Or can I use both?
And one more, Is it compulsary to place every page b4 where ever session_start()

Thanks. Pls help me.

Edited by diafol: apply inline code tags

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by harintfs
0

you can set it once in your php.ini file on the server if you are on a dedicated server.

Otherwise yes you probably will need to set it on every page, you could make an include file so you only need to call the file on every page.

sessionStart.php

<?php
session_set_cookie_params(3600 * 3);
session_start();
?>

otherpage.php

<?php
require_once 'sessionStart.php';
//...
?>

I can't really say which function is better, i'd imagine session_set_cookie_params() is going to be faster and requires less permissions to run so i'd pick that one but i don't know for sure.

0

Also dear, in english, is used as a prefix to the addressee (person/company) so you would say Dear Biiim or Dear Someone.

Dear by itself is something grannies say to young people

0

Thanks, Mr. Biiim. Let I gothrough with your advice. Thanks once again.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.