Session works only after first visit

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Mufleeh
New php-forum User
New php-forum User
Posts: 19
Joined: Sun Jul 03, 2011 10:12 pm

Session works only after first visit

Postby Mufleeh » Thu Jun 06, 2013 4:19 am

Hi All,

I have an issue with the session variable.

shoppingcart.php is the first file executed and contains the following code,

Code: Select all

$postal_charges               =   get_meter_square() * $postageRate;
$_SESSION['postalcharges']  =   $postal_charges;


and once the 'Proceed' button is pressed its re-directed to purchase.php as following,

Code: Select all

window.location='purchase.php';


In purchase.php the value of $_SESSION['postalcharges'] doesn't read. But if I go back and click on 'Proceed' again it reads.

Moreover this happens only on Firefox latest one. Can anyone help me on this?

developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Session works only after first visit

Postby developerahusain » Thu Jun 06, 2013 8:09 pm

why don't use this redirecting code header('Location:url'); instead of window.location.It may be a problem Also check whether you have cookies enabled in the firefox browser.

Developerahusain


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron