473,411 Members | 1,975 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,411 software developers and data experts.

PHP, Galeon, sessions and Content-Disposition wierdness

I'm having a bit of fun with a database I am currently creating using
MySQL and PHP. I seem to have found an odd interaction between Galeon
(1.3.15) and PHP. With plain HTML no problem but when I try to generate a
file/page that is not HTML and get the browser to bring up a window to get
it saved using Content-Disposition PHP seems to create a new session
meaning I can no longer get hold of my session variables.

This only seems to happen with Galeon, not any other browsers that I have
tried.

Any thoughts?

I have created a test page, excuse the redundent comments, it was quick
and dirty:
<?php
//Used for editing - convert all to sessions eventually, it is simpler.
//session_start();

//Re - do, only call session start if the session has not already been started.
/* $session_id = session_id();
if ( $session_id == null ) {
session_start();
}*/

session_start();
$session_id = session_id();
$filename = "test.txt";
//The output data is generated dynamically, we do not want an old copy stuck in a cache.

//HTTP 1.1
header("Cache-control: no-store, no-cache, must-revalidate");

//HTTP 1.0
header("Pragma: no-cache");

//Output a csv file, text/plain for a simple plain text file.
header("Content-Type: text/plain");

//Force browser to save it

//Hmm, this causes problems with Galeon 1.3.15 when not commented out. It causes Galeon
//to create a new session.
header('Content-Disposition: attachment; filename="'.$filename.'"');


echo("Session id:".$session_id);

?>

Jul 17 '05 #1
3 1761
To me, that sounds like something wrong with galeon, especially if other
browsers can do it fine.

I suggest using cookies. I doubt session cookies would work either, but
if you made a cookie that expires in 10 minutes, and kept setting the
cookie on each page load. This would mean it wouldn't expire while
you're still on the site.

Though, cookies are a lot less secure than sessions. I personally
wouldn't put information into a session that I woudln't put into a cookie...
Peter Chant wrote:
I'm having a bit of fun with a database I am currently creating using
MySQL and PHP. I seem to have found an odd interaction between Galeon
(1.3.15) and PHP. With plain HTML no problem but when I try to generate a
file/page that is not HTML and get the browser to bring up a window to get
it saved using Content-Disposition PHP seems to create a new session
meaning I can no longer get hold of my session variables.

This only seems to happen with Galeon, not any other browsers that I have
tried.

Any thoughts?

I have created a test page, excuse the redundent comments, it was quick
and dirty:
<?php
//Used for editing - convert all to sessions eventually, it is simpler.
//session_start();

//Re - do, only call session start if the session has not already been started.
/* $session_id = session_id();
if ( $session_id == null ) {
session_start();
}*/

session_start();
$session_id = session_id();
$filename = "test.txt";
//The output data is generated dynamically, we do not want an old copy stuck in a cache.

//HTTP 1.1
header("Cache-control: no-store, no-cache, must-revalidate");

//HTTP 1.0
header("Pragma: no-cache");

//Output a csv file, text/plain for a simple plain text file.
header("Content-Type: text/plain");

//Force browser to save it

//Hmm, this causes problems with Galeon 1.3.15 when not commented out. It causes Galeon
//to create a new session.
header('Content-Disposition: attachment; filename="'.$filename.'"');


echo("Session id:".$session_id);

?>

Jul 17 '05 #2
On Thu, 04 Nov 2004 01:49:54 +0000, neur0maniak wrote:
To me, that sounds like something wrong with galeon, especially if other
browsers can do it fine.
Yes, sounds like it to me. Unfortunately Galeon has been my browser of
choice.

I suggest using cookies. I doubt session cookies would work either, but
if you made a cookie that expires in 10 minutes, and kept setting the
cookie on each page load. This would mean it wouldn't expire while
you're still on the site.

I suspect the problem is something to do with the session cookie. If that
is the case I can't see how cookies would fix things. It might not be a
big change as although I am using sessions I don't seem to use them much.
I am mainly passing id's via post data as that works well with links (i.e.
a dozen links on one page to the same php script, but each having a
differing user id).
Though, cookies are a lot less secure than sessions. I personally
wouldn't put information into a session that I woudln't put into a cookie...


Hmm, why not? If you can't put it in a session where can you put it?
Jul 17 '05 #3
On Thu, 04 Nov 2004 18:46:34 +0000, Peter Chant wrote:
On Thu, 04 Nov 2004 01:49:54 +0000, neur0maniak wrote:
To me, that sounds like something wrong with galeon, especially if other
browsers can do it fine.


Yes, sounds like it to me. Unfortunately Galeon has been my browser of
choice.


OK, untidy work around in place. Check to see if Galeon is being used as
browse and if it is do not use the Content-Disposition header.
Unfortunately I now have to go to the File -> Save and also change the
file name from the script name. Not neat when Galeon is used but at least
it works.
Pete
Jul 17 '05 #4

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

Similar topics

6
by: Chewy509 | last post by:
Hi Everyone, I'll just start, and say I am not a PHP developer (I'm a sysadmin, who has gotten lumped with a non-working website). But since I like to do this type of stuff, I though I might...
7
by: John | last post by:
Hello. I want to get this blasted .htaccess file sorted out, so I can have sessions without register_globals being on. I have looked everywhere for info on this and I mean everywhere...
3
by: LMachado1 | last post by:
I just started with php and I'm trying to make a simple interface as follows: - user is asked to input an integers, for example: how many students do you want to enter? - user is then shown a...
9
by: Bartosz Wegrzyn | last post by:
I need help with sessions. I createt set of web site for nav with authorization. first I go into main.php which looks like this: <?php //common functions include_once '../login/common.php';...
3
by: Maxime Ducharme | last post by:
Hi group We have a problem with sessions in one of our sites. Sessions are used to store login info & some other infos (no objects are stored in sessions). We are using Windows 2000 Server...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
1
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
7
by: Steve Wright | last post by:
Forgive my ignorance, but I am just starting to learn about sessions in PHP and how to pass data from one page to the next. What I'm about to explain could just be my misunderstanding of how...
3
by: Ben Holness | last post by:
Hi all, I have a php/mysql website where people can upload their own graphics for the buttons and background of pages on the website. This used to run on one server, but I have now been asked...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.