PHP Session Default Timeout
what is the default Session Timeout for php...is there a way to increase this on the web server I am hostign my php scripts on..
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Session Timeout
In ASP I can use the various Session event handlers inside an global.asa file to make an action when the session expires. Is there a way I can do the same with PHP?? I mean, I set a session to expore after 30 mins, and I want to do some cleanup (database related) work after it has timed out?
Session Timeout
I am using following statements in my file for keeping my session live for 24 hours session_start(); session.gc_maxlifetime = 86400; but is giving parse error on line 2. what could be the problem and what is the solution for keeping the session live for 24 hours ?
Session Timeout
I am implementing a site which will be used in an intranet by a limited number of users. The web server i am using is WIN2003 / IIS 6.0 / PHP 5. I want to enable sessions that will not timeout even after a long time (3-4 hours). Having read some of the documentation i concluded that i should set session.gc_maxlifetime and session.cookie_lifetime in my php.ini appropriately, i.e. session.gc_maxlifetime=14400 and session.cookie_lifetime=0. Am i right at this? Furthermore, i am wondering if i should set IIS appropriately, does it intervene with session data(sent session cookies)? I think that Apache does not but i am not sure about IIS.
PHP Session Timeout
Is it possible to set x seconds interval for the "Garbage Collection"? So the PHP deletes inactive session files after x seconds rather than waiiting for session triggering to start the garbage colletction.
PHP Session Timeout
I've modify the php.ini the session.gc_maxlifetime to reduce the time of timeout of the session variabiles. But it not seems to go. In fact the session variabile remain also when after the timeout that i've set.
Session Timeout
How long does it take for a session to timeout,if I have a user logged in on my site, how much time of inactivity will it take before the session is automatically destroyed and they become logged out,i do not use cookies,I have these values in my php info session.cache_expire 180 session.gc_maxlifetime 1440 session.gc_probability 1 from what I understand the session is destroyed after 180 minutes of inactivity,but the session has a 1% chance of being garbage collected after 1440 seconds of inactivity (is this destroyed?) so if I wanted all sessions destroyed after the 1440 seconds, should i set the probability to 100 or should i change the session.cache_expire 180 to something that would suit me better, i.e. the 1440 seconds, i.e. session.cache_expire 24, would this always delete the session after 24 minutes,or do both values have to correspond etc,
Session Timeout...
I want sessions to time out and get destroyed if the user has been idle for more than x time... I already have it so a timestamp is created and sent to the database per user every time they visit a page... so I have this timestamp available... I know you use session_destroy() to destroy a user's session if they visit the link but is there anyway to have a script that say mass destroys sessions based on how old the timestamp is?
Using Session Timeout Without Cookies
I am working on a PHP project where the client is telling me to make a session timeout after 1 hour. I am not using cookies in my site. But as per the php.ini file on the server the timeout had been set to 180 secs (by default), hence the page expires after 3 minutes. Now I need to make this work by setting the session timeout upto 1 hour.
Session Timeout, Use Of Sleep Ect...
I have a custom script that uses sessions to track UID's. The only problem I have with the script is that the session times out in 1440 (min?) which I believe is 24 min. I was thinking that I could use php's sleep to hold off from doing a refresh until minute 20. Unfortunately, I have also read that using sleep can leave a server open to a DoS attack. I do not have access to the php.ini file to be able to change the timeout variable for the session. What is the best way to keep a session open without changing the .ini variable. Is sleep a good way do go about it, and if so, are there significant security risks in using sleep()?
Session Timeout Question
Can I adjust the PHP session timeout on my web site? Users are reporting timeout errors when they leave their computer for a period of time and then come back to resume using the site - is there some kind of global session timeout in PHP that I can set?
How To Session Timeout For Specific WebPage ?
I would like to know how to set the session timeout time locally and not globally in the php.ini file. I do that as it is ine www.php.net but doesn't seem to do anything /***************************/ /* set the cache limiter to 'private' */ session_cache_limiter('private'); $cache_limiter = session_cache_limiter(); /* set the cache expire to 1 minutes */ session_cache_expire(1); $cache_expire = session_cache_expire(); /******************************/ I enter 1 minute for testing purposes.... - Also It would be helpfull to let me know how I am going to verify that the session has been expired.... - Is there any way to automatically refresh the page when the session has expired and let the user know ? - Is there any good site that I can find tutorials or examples for this purpose?
Executing Code On Session Timeout
is it possible to execute some code on the session timeout event? i.e. clear all db information and other stuff when the php session is destroyed through the gc_maxlifetime timeout.
Session Timeout Suggestions Wanted
I have a form where users logged in using sessions can edit articles in a WYSIWYG editor. Some of them take their time and don't like to save their work very often and occassionally the sessions expire and their work goes poof. (I've suggested editing off-line and simply copy+paste but they prefer the editor.) After a lot of searching I've found the main culprit is session.gc_maxlifetime and I can set it longet like... ini_set('session.gc_maxlifetime', 7200); // 2 hour inactive session timeout Are there other timeouts I should worry about with Apache/Linux? (Caches, etc..?) My other php.ini settings are... session.cache_expire180 -> 3 hours shouldn't be a problem session.cookie_lifetime0 -> this is don't expire while browser open right? Now a few of my Google searches came up with a scenario for timeouts where the timezone of server and client have to be considered. i.e. If server is ahead of client by 1 hour, is the session timeout reduced by 1 hour for that client. Can this be true?? Also are there any other problems with a php session lasting 2 hours? Small site, not a lot of users with these priviledges or accessing the editor.
How To Implement Timeout Warnings For Session Expiration?
I am looking for some examples on how to inform the user that their session is about to expire. I would like after some period of user inactivity to display a message that their session will expire and that they will be logged out. I also would like to include in this message asking the user to click a button to stay logged in. I am looking for examples that implement this feature in PHP.
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10. I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???
Curl Timeout Vs Socket Timeout
We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); . . $resp = curl_exec($handle) 2) sockets: stream_set_timeout( $sock, 1); Here we use frwrite() and fread() to send the request and read the...
GD Default DPI
I'm currently making a website that needs to edit images with adding text, the problem is, the picture starts at 300 DPI (pixels/inch), but after GD edits the image, it's set to 72 which i read to be the default value GD always uses. is there a way to edit that default to a higher number, if not are there other ways to edit images through php and still keeping the original DPI.
Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate. After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on. I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On. I thought they were going to set magic_quotes_gpc off by default in the later versions. Anyone know why they did this? Was it a mistake?
What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?
Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.
Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.
Default Variable Value
Does php provide a built in way to use a variable's current value if that variable is already set but to use a default value otherwise. That is, a more compact syntax for: $some_var = isset("$some_var") ? $some_var : "default value";
Set Column Default
we have a table sistock with column cameramodel varchar(30) and try to set default value to blank with the following: ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK', 'BACKORDER','SERVICE','OBSOLETE') DEFAULT ''; and we get an error at the mysql prompt;
ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.
Problem On Default Value : : MySQL
Problem on default value : : MySQL I am facing problem in this line `datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, when I tried to crate a new table in MySQL(version 3.23.47-nt)
Using Default DB, User, Password
How do I use odbc.default_db, odbc.default_user and odbc.default_password defined in php.ini in the mssql_connect() function? I do not want to define these vars globally at the application level for many reasons. Shouldn’t calling the function without any parameters force PHP to look at the INI file for the defaults?
Form With To Submits, Which One To Default To?
Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the cancel. Is there a way (in js?) to "focus" the other button? One other way to be some simple js, which submits the page anyway......
Object Default Value In Constructor
I'm trying to write a class with a constructor that takes a single object parameter. So far so good, but I can't for the life of me make the parameter optional. I understand how to do it with a numerical or textual parameter, but not with an object. I tried null, but it doesn't work. class A { } class B { function B($a = ???) { if (!isset($a)) $a = new A; } }
Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:
PHP Default Host Best Practices
I've got my dev and production environments all setup, and the mysql DBs working fine. What need to do is set the mysql.default_host option in php.ini to be one thing on dev, and something different on production. Unfortunately, my web host doesn't allow me to mess with php.ini. So, what's the best way to specify a different host to mysql_connect() on dev and production. Yes, I could manually edit the variable everything I FTP, but I'd rather not. Should I use a global variable in a separate include file? Other options?
Default Argument Values
something like this possible in PHP: function foo($a=1, $b=2, $c=3) { //... } foo($b=2); Will this assign $a and $c to default values?
How To Overwrite Default Php Installation
On my linux system php seems to have been installed by default. When I type: "which php" it tells me /usr/bin/php I installed php and it has put an executable in the /usr/local/bin/php "which php" still says /usr/bin/php "whereis php" php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php /usr/local/lib/php.ini /usr/local/lib/php -v shows the new version but php -v shows the old version. How can I correct this problem? I want to run the command php -v and it shows the newest version. I have already tried removing /etc/php.ini /usr/bin/php
Default Value To Insert Into MySQL
What should I insert as the default value if a form field is blank? My fields don't currently accept null. if($_POST['height']) { // error checking $height = $_POST['height']; } else { $height = ''; } Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?
Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:
Php's Default Character Set
Where does it say that on php.net, that iso8859 is the default charset for strings? Can't find anything about it.
Display A Default Image?
Is there an "if" statement I can use to check if an image exists in a certain directory, and if it does display it, but if it doesn't exist then display another image in a different directory? I've written simple "if" statements for text display, but nothing like this. Is this possible? It might help to tell the scenario. I am putting together templates for teacher web sites. If they wish, they can upload their own logo into their upload directory to display at the top of the page, but if they choose not to upload their own logo I want the default (district) logo to appear there. The default logo is located in another directory on the same server.
Default Error Page If No Rows
If there are no rows in the result of my query, instead of just showing some text in the browser saying no rows found, could i redirect to a standard error page using this function?
Need Access To Default File Attributes
When I was first learning php, I created an upload script. The basics of the script had: <form method="POST" ENCTYPE="multipart/form-data"> <input type="file" name="FILE"> <input type="submit" name="SUBMIT" value="Upload"> </form> Then in the submit section, it accesses the filename and filesize by virtue of a default php ability to extract these attributes by using: $FILE_name and $FILE_size (where _name gives the name of $FILE and _size gives the size of $FILE). if($SUBMIT) echo " Filename: $FILE_name <br> Filesize: $FILE_size"; Also, I did add the necessary lines to handle the post variables, like so: $FILE = $_POST['FILE']; $SUBMIT = $_POST['SUBMIT']; I have tried to mimic this script in a new upload script, but am unable to access those same attributes (_name and _size). At the time of my original upload script, we were running it on a Linux server (but I don't remember what we were running for a php version). Currently, I am running PHP 4.2.3 on Mac OS 10.2.8 server. One thought I had was that maybe PHP 4.2.3 no longer supports _name and _size. Or, maybe I am not handling the retrieval of the POST var for the file correctly? I wonder this because I did try print_r($_POST) and I only got the submit returned as a post var.
Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which rows in the database have GK, MID, DEF, FWD against them and then put SELECTED into the option value to give a default of what the entry is currently) it just adds SELECTED to all the results as if $row["Position"] is returning true against all four conditions? What am I doing wrong? CODE:..
Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might tell how? I'm using the following html code and trying to get the time to default into the text box. thanks html code <tr> <td><b>Date:</b></td> <td align="left"><input type="text" name="date" size="8" maxlength="8"></td> </tr> php code <? print strftime("%m/%d/%Y"); ?>
Default Function Argument Issue
function test($foo=array()) { echo gettype($foo); implode(' ',$foo); } foo(); This code will output: null and generate the error Bad arguments. in .... on line x ( bad implode args ) what's the deal? $foo should be an array!
Send Default Apache 404 Error From Php
How can I trigger the default Apache 404 error from PHP? I don't want to specify a custom handler, I want the default handler. The reason is that I am using mod_rewrite with Apache for my site. If certain a certain page is requested that is not published, then I want to send the apache default 404 error page. Currently, I am doing this to return a custom error. if($pageNotPublished) { header("HTTP/1.1 404 Not Found"); // How do I send the default apache 404 message // instead of the message below? print("<html><body>HTTP 404 - Not Found</body></html>"); exit(); } The default 404 error page has more details,
Default Home Page Under Xampp.
Is there a way to change default home page under Xampp, so that when I type http://localhost it would go to a home page other than page with popup asking for Xampp authorization.
How To Change PCRE Default Delimiters
I try to use alternative delimiters for a regular expression. When will it be supported? www@mike:/home/www > /usr/local/bin/php -a Interactive mode enabled <?php preg_match('m!A(d*)B!', 'A12345B', $X)); ?> X-Powered-By: PHP/4.2.3 Content-type: text/html <br /> <b>Parse error</b>: parse error in <b>-</b> on line <b>2</b><br /> http://perldoc.com/perl5.8.4/pod/perlrequick.html
How Can I Delete The Default Apache And Php On Linux?
I installed php4.0.2 and apache 1.3.12,but I use the function phpinfo() checked the version of the php,it always tells me it is 3.0.15,so I want to delete the default apache and php on linux,so I can install new php4 and apache and it can connect to the mysql.By the way how can I get rid of the php and apche which the in linux when I installed the linux.
|