Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





How Long To Session Vars Last?


How long do session vars last? I believe some of my applicants are taking a long amount of time to complete their app, which is creating problems. Is there a way to lengthen the time that a session var is available? I would also like to do this to allow admin/csr's to stay logged in longer without having to log back in.




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How Long For A Session?
how long a session lasts for. It's been a long time but I thought it was 20 minutes by default. IS this correct or is it some other time? Assuming the browser is not closed of course.

View Replies !   View Related
How Long Does It Take For A Session To 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,

View Replies !   View Related
How Long Session Will Be Alive ?
is it good to use both session and cookies to increase session's time ?

View Replies !   View Related
How Long A Session Will Last Before Expiring
Is their a way to set how long a session will last before expiring, without changing settings in the PHP config file, and is their a way to grab all the active sessions.

View Replies !   View Related
Session Vars
My session variables are not being saved. But my session.use_trans_sid is on. I used the test by toplay in this post and it put the SID in the URL - which I guess means that session cookies aren't allowed, or something. Well, I am not sure what exactly needs to be turned on for this.

The actual site itself is on a server that I can't really send a link to (because we are moving the site to new server, and the dns currently points to the old site, where the session ids are working) But, I copied & pasted the phpinfo from the new one (where the session ids are not working) into an html file. I was hoping someone could look at it and let me know if there is something I need to change?

View Replies !   View Related
Make The Session Timeout After So Long?
how can you make the session timeout after so long?

View Replies !   View Related
Session Id In A Long Life Cookie
Okay, my session's cookie is by default set to destroy on session closure. I want to make this cookie last 30 days. the only way I came up with is to put:

session_set_cookie_params()

before every time I say session_start(). Is there an easier way to do this? something that I can do only once?

View Replies !   View Related
Session Loosing Vars
I'm using sessions to store some vars that are needed thruout my shopping-cart. sometimes the one or other var is lost. It doesn't happen often so we did a lot of testing and found that if the session looses a var it's not always the same var.

We already downloaded opera and NS7 to see if it was a ie6 related problem. but it does not seam like its a browser related problem.

What could it be? what can be done to fix this?

View Replies !   View Related
Not Able To Retrieve Session Vars
everything seems to work fine when I test if a session variable is stored on the page that is was stored (after login I print off the login name stored in the session object). I then remove the test print statement and put in a header("Location...) to forward the user to the next page. It is at this page that I seem unable to retreive the session variable. I check the folder where the session objects are stored and the object file is still there, but.

View Replies !   View Related
Use Of Constants Or Session Vars
Does anyone see a problem with using defined constants as opposed to $_SESSION vars for holding data like a users id, name, email, etc.. Basically when a user logs in, I register their relevant info in session vars and use them throughout the app to be used in queires. so theres a lot of PHP Code:

View Replies !   View Related
Setting Session Vars
I developed a very simple - register - login script using what little php knowlage I have and The more i test it, the more holes I find. My session variables dont work, and it lets anyone who acesses Login_success.php without checking for login name and a valid password, Now I read alot about sessions so I think I'm having trouble setting session variables, but I'm not sure what to do, and on top of that, my md5 hash is messing up!
This is my login script "log.php" PHP Code:

View Replies !   View Related
Globals Off, So Are Session Vars
How do you address session vars without globals? aight, here's an exmple PHP Code:

View Replies !   View Related
Reassigning Session Vars?
I'm trying to create a change password option on my site. I'm using session vars to keep track of the users username/password .. which I pass to an authcheck function on each page. The problem I'm having is this. When I change the users password, no more pages will load because the password that's stored in the session var is not the same as whats in the DB anymore.

How do I go about changing the session var to reflect the new pass? Currently I'm trying:
$_SESSION["SESSION_PASSWORD"] = $newPass; Which I assumed would reasign what was in SESSION_PASSWORD to the new pass.

View Replies !   View Related
Unset Session Vars
I have a issue here and want some help if possible:

I have a logout program saying the following:

session_start();
unset($_SESSION);
$result_dest = session_destroy();

and apparently works fine, as the $_SESSION variable is empty when executed, but the thing is that if the user press back in the browser, he can still view the $_SESSION variables set, and perform any task, although he is already disconected from the system. How can avoid this?

View Replies !   View Related
How To Unset All Session Vars
I'm writing a script where a user can delete account. While user is logged in there are a few vars set into session. How do I unset all of the sessions? I must be having a mental block...


View Replies !   View Related
Session Name And The $_POST Vars
what happens when the session name and the $_POST vars or $_GET vars names are same.
ie

$_SESSION['sess_name'] = "xyz";
$_GET['sess_name'] = "abc" ;
Thanks in advance to all of you.

View Replies !   View Related
Performance SESSION Vars
When a user logs in I select account related data and set it in SESSION vars, like $_SESSION['myvar']. Currently it's about 40 vars per account. I do it on login once so that I don't have to query db when I need this data. Now, is it a good practice or would it be OK to query db whenever I need data?

I basically use most of it anyways, but at least it's already available. Say I have 1000 members logged in around the same time, that's 40K session vars set. Does that affect the performance of my server a lot? What is the best way to deal with similar issues?

View Replies !   View Related
Arrays In SESSION Vars ????
Can an array be stored in a session variable???? Or will the variable
of the type $_SESSION[...] hold scalar values only?
My attempts failed but that's probably because I did "something" wrong
:-).

I just wanted to be sure before I break my head over something
impossible.

View Replies !   View Related
Long Post About PHPEclipse Session Debugging
debugging PHP applications interactively is possible, easy and free. I
am talking about PHPEclipse and using it for debugging over several
scripts or debugging through a session. Since I have wasted a lot of
time writing echo statements all over the code in order to confirm
program flow and watch variables, I feel I must share this with others
who will be facing similar problems.
PHPEclispe users can go to Step 5 directly.
(People who already have software which does all this or feel that
their software is the best suited, please ignore this post :-))

1)
First you need to get PHP and Apache.
(My OS is Windows XP Pro.) The best choice IMHO is XAMPP, as it allows
you to do many things - my version is 1.4.15 and it has, apart from
Apache2.0.54 and PHP5.0.4, phpMyAdmin2.6.3, FileZilla FTP, Webalizer
and many more things. It also allows you to switch between PHP4 and
PHP5!
So, get XAMPP at http://apachefriends.org.

2)
Second, you need to get PHPEclipse.
For that you need Eclipse first. Eclipse can be got from
http://eclipse.org. There are two releases of Eclipse - Eclipse 3.0 and
Eclipse 3.1 (although I use 3.0, it seems 3.1 is the better one - also,
there are other free products like JSEclipse which need 3.1 - sooner or
later you will need Javascript in your PHP application, for that, you
need Eclipse 3.1) Installing Eclipse 3.0 on windows was as simple as
unpacking the zip into a folder, say c:eclipse and double-clicking on
eclipse.exe to start. I've not tried 3.1 but I believe the installation
should not be any more difficult.
**********
Before downloading anything first read up the PHPEClipse related wiki
page at http://www.plog4u.org/index.php/Using_PHPEclipse
**********
Also read up http://www.plog4u.org/index.php/PHPEclipse_FAQ
NOTE: PHPEclipse runs from within Eclipse as module ("plugin").

3)
After you install Eclipse and PHPEclipse, comes the important part. I'm
just writing the steps which confuse most - since you have all the
necessary help needed available at
http://www.plog4u.org/index.php/Using_PHPEclipse in detail. Assuming
you have PHP files ready which you want to debug, you need to create a
new project in PHPEclipse. Go to Window->Show View->Navigator. This
shows the navigator pane. Now right-click to get a pop up menu which
gives among other options New->Project. Click that and choose PHP->PHP
Project in the next form in the wizard. Click Next to get the New
Project (PHP Project) form. There you have a place to give your project
a name and a place to specify the folder (you will miss this one if you
do not look closely as you need to uncheck a checkbox labelled "Use
default"). Now specify the folder location in the folder selection box.
This step troubled me for quite some time.

5)
Follow http://www.plog4u.org/index.php/Using_PHPEclipse for
intermediate steps like getting and installing the DBG debugger

6)
For debugging, you start by first setting up the environment by setting
paths and options in PHPEclipse. Click on Run menu in Eclipse, then
"Debug ..." (Debug dot dot dot). A window appears with a
navigator/explorer pane on the left and many tabs on the right. Give a
name (anything) to the debug configuration. Enter the paths in the File
tab and the Envirnment tab. Environment has two sub-tabs - Remote Debug
and Interpreter. In Remote Debug, check the Remote Debug checkbox and
(MOST IMPORTANT) uncheck the "Open DBGSESSION url in internal browser"
checkbox. This is needed, we will soon see why. Also, set the Remote
SourcePath to be a part of the full path to your php script. The rule
about the RemoteSourcePath is that
(RemoteSourcePath in the Environment tab) + (File path in the File tab)
= actual full path to your php file.
On the Interpreter sub-tab, if you have set things up correctly (with
XAMPP) you should see a php and a php5 option. Choose either. If
nothing is shown, you can add an interprter by setting a name for it
and the path for it from the adjoining "New..." button. Try a few
things and you should be able to start a debug session in about an hour
if not in a few minutes.

7)
Finally, run the Debug configuration (i.e., start the debugger) It will
now switch the window layout and show an active red button in the debug
toolbar with a few debug details in a prominent debug pane. It is now
_waiting_ for a request from any browser application. Set a breakpoint
in your PHP code (double clicking on the thin margin at the left of the
source code window, next to the text area). Also, set a breakpoint in
the next file that will get called when the user performs a form
submission in you first page.
Now, open your favorite webbrowser (independent of PHPEclipse) and
enter the url :
http://localhost/myproject/myfile.p...localhost:10001 or
http://localhost/myproject/myfile.p...lienthost:10003 One
of these should work. A moment or two after you enter this (PHPEclipse
must be in the waiting-to-debug mode) you will see control switching to
PHPEClipse and the line in your first page where you set a breakpoint
will get highlighted by the debugger. Step through to the end. and
switch back to your web browser (where page two is now being
displayed). Click on a form submit and see how control switches back to
PHPEclipse on the line in the second page where you had put a
breakpoint.

Thus you continually switch between your web browser and PHPEclipse.
The process can go on to as many number of files as you wish - just set
breakpoints in all the files before starting debugging. Trust me, it is
a good alternative to writing echo statements all over the place to
trap errors in a 15-20 page PHP application.

NOTE: On Windows, when control is switched to PHPEclipse, the Windows
taskbar button for PHPEclipse blinks, indicating that that program
demands interaction. I dont know how it is on Linux.

The important thing is to not start the debugger in the internal
browser. For that you must uncheck the checkbox saying "Open DBGSESSION
url in internal browser" which can be found in
Run->"Debug..."->Environment tab->Remote Debug tab. Somehow, (on my
machine at least) the internal browser does not support debuging over
multiple pages.

Hope this helps someone, because I've wasted a lot of time adding
echo's and exits to see the state of variables in various places in my
scripts and it is quite tedious. That kind of debugging has its merits,
though - you become really well versed with your code!

View Replies !   View Related
Accessing Session Vars With Register_globals=on
I've spent ages getting this website working on my machine running all the latest php(4.0.6) and mysql (3.23) to get an online clip library working, and it worked fine... so I upload it to the webserver and it doesn't work.

Now I eventually found out it wasn't working because the session variables I had used for storing user info and shopping cart info were empty, even though they had been set (I got it to echo the values out when I set them).

It turns out it was because the webserver has register_globals On and not off like my dev machine. Unfortunately I can't change this on the webserver because it's not my server, but can anyone help me out on how to get it to work??? If I turn register_globals off it works fine, but if turn register_globals on the session vars aren't accessible.

View Replies !   View Related
Speed: Session Vars Vs MySQL
I have one php script that is frequently being refresh to print some data. Do you think retrieving the data from MySQL db would be better or retrieve one time from MySQL db, store it in an session array and read from the session var every time the page refreshes?

I believe using session variables is reading from a text file. So, reading a session text file or db? What do you think?

View Replies !   View Related
How To Share (or Read) ASP Session Vars Within PHP?
I have programmed for 4-5 years developing an extensive system using ASP
utilizing Session() variables to pass information between pages when needed. Now that I am using PHP more, interoperability is becoming a concern.

Is there a way to share Session information between PHP & ASP? I would at least like to read info stored in existing ASP sessions. Sharing using "files" is cumbersome but a utilitity could be written to "export and import" could work.

View Replies !   View Related
Users Session Vars Overwritten?
I am using session variables in order to insert the username into the database when the user submits a form. I was just wondering as I don't fully understand session variables could this cause any problems? For example if one user logs in and then another will the first users session vars be overwritten?

(I am only making a localhost site which is run locally, so if I did this on my machine logging in two different users one in firefox one in ie would this also be ok?)

View Replies !   View Related
Passing Session Vars Between Servers
I have some session vars I want to have "waiting" for the user when he gets to another server. I can send things via FTP (Usin PHP's native functions) to send a file to the other waiting server, and of course when I redirect I can also pass the session id.

Part I don't know how to do is to send serialized variables as a file and put in the /tmp directory so the new server recognizes them as session vars - anyone else know how to do this?

View Replies !   View Related
What's The Cleanest Way To Set Session Vars From HTML
I have a page that displays pictures, large or small. I want to detect the current size using session vars and avoid any additional text on the end of my web address (ie.?action=new&large)

Currently to set large pictures the user clicks a button which redirects the user back to the current page with "&large" on the end of the web address.

My PHP then sets the session varaible when it detects this, next time the page is loaded it remembers.

if (isset($_REQUEST['large']) $_SESSION['large'] = 1;

$picSize=150;
if (isset($_SESSION['large']))
if ($_SESSION['large'] == 1) $picSize=250;

View Replies !   View Related
Problem With Session Vars Being Propagated Between Pages.
I am having a problem with session vars being propagated between pages
on this site:

If you enter any user id and password and click Log In (no actual
validation is performed), and then move around the other pages and/or
keep refreshing the pages it will eventually display something that is
incorrect i.e. saying your logged in when you aren't or vice versa.
The exact same code here http://ccgi.gnosis.free-online.co.uk/index.php
works fine implying a problem with the first PHP installation.
Here is the code for the 3 files:
=========== index.php =============
<?php
session_start();
if (isset($_POST['userid']) && isset($_POST['password'])) {
// if the user has just tried to log in
$userid = $_POST['userid'];
$password = $_POST['password'];
//assume valid login so set session var
$_SESSION['loggedinusername'] = $userid;
}
?>
<html>
<body>
<h1>Home page</h1>
<?
if (isset($_SESSION['loggedinusername'])) {
echo 'You are logged in as: '.$_SESSION['loggedinusername'].' <br /

Quote:

View Replies !   View Related
Session Vars Disappearing If PHP File Larger Than 12k
First of all, this code worked fine on Windows 2000 and PHP 4.3.4. This problem occured when I moved the code to a Windows 2003 with 4.3.4. The problem continued after upgrading to PHP 4.3.11. I create a session, and set certain session vars, and call page 2. Everything works fine. Code:

View Replies !   View Related
How Long Is Too Long For A Script To Execute? GetTimer()
I'm using some scripts and they're executing from

.007 - .010

It defines many files, imports several files (total of maybe 20), encrypts 2 strings several times base64 IN flash, WWW-Authenticating to a PHP file, PHP grabs a MySQL Query, returns it, traces it.

That happens all in .007 seconds roughly. How long is too long until you should find a new script. If a script runs with a time of .05, is that the general limit or is that fast?

View Replies !   View Related
Strtotime And Dates Long Long Ago ...
while making an encyclopdie on my hometown (dutch,
http://www.kgv.nl/index.php?id=610) i am trying to use dates prior to
1970. birthdates in, let's say, 1615.

i'm getting errors while working with these dates, for example when i am
calculating which day of the week it is. the dates are stored in a
mysql database.

is there another way to convert stringtype dates to work with?

View Replies !   View Related
How To Create New Vars Based On Vars?
I am trying to create new vars based on information that is stored in an array. I plan on adding value to these vars later on but need to figure out how to dynamically create new vars fists. Code:

View Replies !   View Related
How Long Is Too Long For A Cgi Script?
I have a 4000 line php cgi script that is not memory or cpu intensive.
It runs in 1 second. Now I am getting a lot of customer requests to add
in new features. My question is if there is a point where my code will
be too long and take too long to run (i.e > 5 seconds). I would really
like to have my script rival the functionality of a desktop application
but can php do it?
My server is a dual processor with 2GB ram.

View Replies !   View Related
Login Script That Checks Long Long It Has Been Since A Last Login
i need to make a login script that checks long long it has been since a last login. I have Mysql so i can use that to store the last login date. Can someone help me figure out how to find how many days ahve passed since a previous login. Like what format should the last loin date be stored in. Also how i get it to figure out how many days have passed since the last login.

View Replies !   View Related
Warning: Session_start() [function.session-start]: Cannot Send Session Cookie - Problems With The Session Variables.
I am have a form on the page registration.html the content is posted to a page called registration.php Although the database is getting populated, i am having problems with the session variables. I get the following errors:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /usr/shared/web/intocore/registration.php:10) in /usr/shared/web/intocore/registration.php on line 41 Code:

View Replies !   View Related
Long Text
im trying to figure out how to format text in a database ... If I have a TEXT AREA in a form .. and an user inputs say like 5 paragraphs ... how can I have it to where mysql will display that as 5 paragraphs and not just i chunk of text when i display it at a later date ?

View Replies !   View Related
Long Insert
I need to update a table in mysql and the information is very long. I changed it to Longtext and whenever i use php to update it, the query returns true but the data never gets inserted into the database. Here is an example of the text that would be entered: Code:

View Replies !   View Related
Long String
I have made a forum, it is working fine. Came accross a new problem today, someone posted a long website address, and the table that the text is written in stretched to fit it, making the page much wider than it should be. How can I make sure that long web addresses or wordswithoutspaces will not ruin the aesthetics of the forum?

View Replies !   View Related
One Long Line?
I was wondering, when I view my source in the browser my PHP code shows
as one long line. Any ideas why this is?

View Replies !   View Related
Long Decimal
I am using PHP 4.3.3 I am developing a site about astronomy the needs high precision calculation (that will use numbers of 20 decimal points). I've increased the precision value in php.ini to 25, but PHP seems to accept only 15 decimal points.

View Replies !   View Related
Determine How Long It Was Since Last Logged In?
I can insert the date and time into a SQL table, but where do I go from there? What would I use to figure out the exact minutes since they were last on?

Also, the minutes need to round to hours, and hours to days.

View Replies !   View Related
Oracle + PHP + Long Process
Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB
on a separate Linux box.

I need to create a PHP web interface to allow an end-user to run a PL/SQL
stored proc that will do a force refresh of a series of materialized views
following the loading (through another PHP interface) of additional flat
file data into the underlying tables. I want to allow multiple data
uploads and then do a single refresh, so I won't be able to use fast
refresh or other internal database trigger mechanisms.

My real problem is that the time taken to execute the stored proc is
likely to considerably exceed the max script execution time for PHP, and I
don't want the end-user interface to just sit there bubbling away waiting
for the Oracle processes to return a response anyway.

I am considering creating a "master" PL/SQL stored procedure which would
use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a
"background" (to the PHP interface) process.

Is this the way to go, or are there other better solutions that I am
overlooking?

View Replies !   View Related
How Long Can I Make A Cookie Last?
I realize that the "cookie" is not a PHP-specific topic. However, I'm developing my web site using primarily the PHP programming language so I thought that the PHP forum would be an appropriate place to post this question.

My question is this: Is there a limit on the amount of time that a cookie will remain on a user's computer? In other words, if I code a time frame of a year or two for the cookie to expire will the cookie stay on the user's computer for that long?

View Replies !   View Related
Long URL Breake My Html
I have small BB and when someone post long URL it breaks complete forum.
Is there anything I can do.

View Replies !   View Related
Condensing Long Strings
Say I have a really long URL e.g. http://www.testing123.com/testing123/testing123/testing123/testing123/testing123.html

What I want PHP to do is to condense it in a way that most popular forum software does. So the resulting URL should look like http://www.testing123.com/testing12...testing123.html

I'm guessing regular expressions would do something like this, but I don't have a clue at how to accomplish this.

View Replies !   View Related
Session_start Costed Too Long....
I used ajax.
When the first time I visit the page, it spent about less than 0.3s
but when I visit the same url second time, it cost more than 10s, I
located the session_start(); call ,what is the problem?

View Replies !   View Related
Foreach On A Long Array
My array:

$pos_array = array(
0 => array("p1_pts" => $pts_1, "user_id" => "$p1_id", "pos" => 0),
1 => array("p2_pts" => $pts_2, "user_id" => "$p2_id", "pos" => 1),
2 => array("p3_pts" => $pts_3, "user_id" => "$p3_id", "pos" => 2));

How would I do a Foreach on a long array like this?

I know the basic ($pos_array as $x => $y) but not anything bigger.

View Replies !   View Related
Convert Double Value To Long Value
I have this issue with doubles values. When I store a long value like 1234567898999, the data is stored like 123E+10 or something like this.

I need retrieve the data like long value, like 1234567898999, but I need store it like double value.

View Replies !   View Related
Displaying Long Text
I have a MSSQL 2000 database with survey data, the data field that contains the long data is varchar (8000). When I display the data it truncates the data to 255 characters including spaces. The following code is something like this:

while($Results=mssql_fetch_array($SQL_Query) {
echo $Results[0]."<br />";

}

Is there something that I am missing?

View Replies !   View Related
How To Handle Long Process
i am developing a php web application where some programs requires a long time to process, such as going through a large table in a database and updating fields in each record.

how can i do this without causing a page to timeout?

View Replies !   View Related
Break Long Words Up
How can I break long words up, I tried wordwrap, but it didn't work.. anything else I can try..

View Replies !   View Related
Shorten A Long String To .
I'm outputting a large amount of data from mysql and I want to shorten it. I want to change this display "Once upon a midnight dreary, while I pondered weak and weary. "

to something like this "Once upon a midnight ..." Any ideas guys? I bet I'll get a fix in 10 minutes.

View Replies !   View Related
Replacing Too Long Stringswith
I have: echo $item;

and it puts out a string. the problem is it should check if the string is not longer than 40 characters, and if it is it should cut it at 40 and then replace it with "..." any tips how to do this?

View Replies !   View Related
Long Encrypted String
When I login the hotmail, I got a 64 character long string as part of the URL and it changes each time I login. Also when I login in Yahoo email, there is a 13 character long random string generated. Can someone tell me what purpose they serve? I am just wondering if it's better if I change the all the user IDs in my system from auto_increment to a encrypted 32 or 64 long string.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved