Hi
Ive just switched to using sessions for my login system, however I find that (and my users) that while navigating between pages, or different windows, the session is lost and a re-login is required.
I was wondering if it is possible to start a session for a fixed period of time?
http://www.alljammin.com -Free funky dating and flirting
Controling sessions
Moderator: General Moderators
-
malcolmboston
- DevNet Resident
- Posts: 1826
- Joined: Tue Nov 18, 2003 1:09 pm
- Location: Middlesbrough, UK
you are using
on every page right?
Code: Select all
session_start();Ok, every I have done everything in the thread, but.
I'm developing a page with Apache 1.3.X and php-4.3.4,
under Windows 2000 professional.
In my php.ini file I had set the session_path="C:\php\sessions"
when I start the session with:
<?php
session_start();
$_SESSION['myvar]='Some string';
echo '<a href="test.php">Test</a>';
?>
This creates a file with the name:
sess_56#######.....etc.
When I edit it is says:
myvar|s:11:"Some string"
However, when I hit the Test link on my page
the value does not exists in the new page, and
it creates me a new session file in the session folder.
The code for the test.php file is:
<?php
session_start();
echo $_SESSION['myvar'];
?>
Any help will be appreciated.
MAGO
I'm developing a page with Apache 1.3.X and php-4.3.4,
under Windows 2000 professional.
In my php.ini file I had set the session_path="C:\php\sessions"
when I start the session with:
<?php
session_start();
$_SESSION['myvar]='Some string';
echo '<a href="test.php">Test</a>';
?>
This creates a file with the name:
sess_56#######.....etc.
When I edit it is says:
myvar|s:11:"Some string"
However, when I hit the Test link on my page
the value does not exists in the new page, and
it creates me a new session file in the session folder.
The code for the test.php file is:
<?php
session_start();
echo $_SESSION['myvar'];
?>
Any help will be appreciated.
MAGO
Maybe this can help you?
I had the same problem, check your php.ini and locate this:
session.use_trans_sid = 0
and change the 0 to 1:
session.use_trans_sid = 1
Then reboot your puter.
And then your script will work, promise.
And 4 some code, have a look at my little test.
First page
Second page
session.use_trans_sid = 0
and change the 0 to 1:
session.use_trans_sid = 1
Then reboot your puter.
And then your script will work, promise.
And 4 some code, have a look at my little test.
First page
Code: Select all
<?php
session_start();
$un = "anders";
$_SESSION['uname']=$un;
$_SESSION['ualias']='olle';
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
?>
<p><a href="test4.php">Page 2</a></p>Second page
Code: Select all
<?php
session_start();
echo '<pre>';
print_r($_SESSION);
echo '</pre>';
echo $_SESSION['uname'];
echo $_SESSION['ualias'];
?>