Problem with Session


#1

Hello,
i have a problem with the $_SESSION in my website.

I have 2 pages :
1.php:
<?php
session_start();
$_SESSION[‘email’] = ‘test’;
header(‘Location: /2.php’);
?>

2.php:
<?php
session_start();
var_dump($_SESSION[‘email’]);
?>

but i obtain NULL because the Session it’s not fonctionnaly…
Can you help me ?


#2

Did you use session_start() in both pages?


#3

Yes, sorry i have edit my page :wink:
With Wampserver my page is functionnaly…


#4

Is the problem solved now?


#5

No, because i need to use 000webhost and it’s not functionnaly…


#6

Please give me your webaddress


#7

This is my webadress : HIDDEN


#8

Akismet has temporarily hidden my post, you have the web adress ?


#9

Can you remove header function for a while?


#10

it’s a test page, the header it’s not present :wink:
1.php and 2.php it’s only php code for Session


#11

Remove above line



#12

i have remove this line


#13

Use print_r instead of var_dump :wink:


#14

Ok, it’s done but nothing is displayed


#15

Looks like you are using special quotations
Please use ’ instead of ‘


#16

@SkyReezHD Add this in your “.htaccess” file and then try again,

php_flag output_buffering on


#17

@ckhawand i have test but the problem persist…

akhilkumar332 i have test but no changement…


#18

@SkyReezHD Clear your browser cache and data and then try again.

But don’t remove this from your .htaccess file.


#19

no changement ! ^^
Session is NULL in 2.php

It’s a problem with the server no ?


#20

What is the website in question?