User sessions only work in ie

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

User sessions only work in ie

Post by pinehead18 »

session_start();
header("Cache-control: private");



That is the code for my user sessions. It seems that in opera or firefox that this does not work.

i set the sessions like this.

Code: Select all

session_start();
	$uname = $_POST['uname'];
	$_SESSION['name'] = $uname;
Thank you for any information you can provide me.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

just for the hell of it.. why wouldnt u do

session_start();
$_SESSION["name"] = $_POST["uname"];


????????
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

Well, that wasn't even suppose to be their. And that really doesn't help the fact it does not register in opera or firefox does it?
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Are they set to accept cookies? You set any specific security restrictions on those browsers?
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

See the thing is, it does not just happen on my browser it happens on all opera computers.

Does opera come set not to accept cookies?

Thakn you
Anthony
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

Actually if ounjd the problem. A rather weird. I was told i needed the fix header("Cache-control: private"); in order for sessions to work in IE. However, when i use that my sessions wont work in other browsers.

Do i have to include header("Cache-control: private"); under every session_start(); ?

Thank you
Anthony
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't remember needing the Cache-control header for IE to use cookies... :roll:
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Ive never used it in my life.
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

kool, thank you.
Post Reply