473,406 Members | 2,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Session id keeps changing

DC

--when i set session.cache_limiter = private i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
Expires: Thu, 19 Nov 1981 08:52:00 GMT
No idea where it's pulling that date from. (Clearly already expired)
--when i set session.cache_limiter = private_no_expire i get this
Set-Cookie: PHPSESSID=61fdf683fef689d5371a1c01fd46e678; path=/; secure
(no Expires line)
But my session ID still changes every time i refresh the page.
What do I have set wrong???

php.ini
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp
session.cookie_secure = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
;session.serialize_handler = php
session.serialize_handler = wddx
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.bug_compat_42 = 0
session.bug_compat_warn = 0
session.referer_check =
session.entropy_length = 16
session.entropy_file = /dev/random
;session.cache_limiter = nocache
session.cache_limiter = private_no_expire
session.cache_expire = 180
session.use_trans_sid = 1

<?php

session_start();
echo '<pre>';
var_dump($_SESSION);

//$_SESSION['test'] = 1;
$_SESSION['test']++;

var_dump($_SESSION);
echo("SID: " . SID . "\n");

echo("session_id: " . session_id() . "\n");
echo '<pre>';
//session_unset();
//session_destroy();
?>

Jan 19 '06 #1
4 5526
DC wrote:
What do I have set wrong??? <snip> php.ini
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp

<snip>

Do you have a "/tmp" directory in your server?

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Jan 19 '06 #2
DC
On 19 Jan 2006 19:17:04 GMT, Pedro Graca <he****@dodgeit.com> wrote:
DC wrote:
What do I have set wrong???

<snip>
php.ini
[Session]
; Handler used to store/retrieve data.
session.save_handler = files
session.save_path = /tmp

<snip>

Do you have a "/tmp" directory in your server?

of course.

I did check anyway, and even changed it... it's definatly not a problem with that line.
Jan 20 '06 #3
DC


It seams that I'm only having my session_id problem when "session.cookie_secure" is true.

to emulate what is happening, I ran the following from the command line:
(the webdeveloper plugin for firefox confirms the same thing is happening in the browser)
"sudo -u apache php /path/to/website/session_test.php"

When session.cookie_secure = true ( Session ID changes every time i refresh the page)
I get this:
Content-type: text/html
Set-Cookie: PHPSESSID=2936ca56baebc8ef01e0fed93cf15a82; path=/; secure
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Thu, 19 Jan 2006 17:35:44 GMT
When session.cookie_secure = false (Session ID remains the same like it should when refreshing the page)
I get this:
Content-type: text/html
Set-Cookie: PHPSESSID=0439f6dc5efab92a2b4c764a3d1ac077; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: private, max-age=10800, pre-check=10800
Last-Modified: Thu, 19 Jan 2006 17:35:44 GMT


Also, whats up with that date???
Jan 20 '06 #4
DC wrote:
It seams that I'm only having my session_id problem when "session.cookie_secure" is true.
Hmmm ... do you have HTTPS set up?
secure cookies are set *only* if a secure connection exists.

When session.cookie_secure = true
Expires: Thu, 19 Nov 1981 08:52:00 GMT

When session.cookie_secure = false
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Also, whats up with that date???


Hey! One problem at a time, please :-)

--
If you're posting through Google read <http://cfaj.freeshell.org/google>
Jan 21 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tony G. | last post by:
Hi there, I have an APS 3 application, running on a Windows 2003 Web edition server - it is a very busy website, and when users are click on certain links (membership info), a new window i...
7
by: someone | last post by:
Let's say I have a Session timeout of 20 minutes. If the browser periodically request a graphic file, will that keep its Session alive? What keeps the Session alive? Is it the Session cookie that...
8
by: Ben | last post by:
Hi there I am writing a C# application that is making multiple POST requests to an ASP.NET page. I would like to take advantage of ASP.NET sessions to store some data on the server side. Where do...
3
by: Jon | last post by:
All, I have a question regarding the usage of sessions and cookies. I'm still a fairly new developer, but have built quite a few login-driven applications using MySQL for the backend and PHP for...
1
by: DrJarmin | last post by:
Hello The problem is this: in the criteria for a list box I reference the parent form - and Access KEEPS changing the criteria for one that won't work. Details below: I have a couple of list...
8
by: NilMS | last post by:
Hi, I have created a test Web Application Project. Default.aspx just has a button. Page_Load has following code: protected void Page_Load(object sender, EventArgs e) { ...
3
by: dihola | last post by:
Hi, I have a website running in IIS7 and it seems to be creating a new session for every request I make. The values I store in Session are lost with every request. This is the forms bit in my...
6
by: =?Utf-8?B?QnJlbmRhbiBLYXk=?= | last post by:
Hi there, We have an ASP.Net application that is generating huge numbers of Context Switches when a certain number of active users are present. We tried changing the configuration of the...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.