Hi Sam
I have following case and question:
From what I know till now, the session ID is set in the moment somebody enters the page. Is it possible that this depends on the browser? Or, in other words, is it possible that the "persistence" of the session ID starts for some browsers at the moment of entering and for some others after the first click?
I'll explain what I'm trying to do: I made the login.php page to open into a shadowbox window. After submit, I lead to a login_success.php page (in same shadowbox). There I have a button that is closing the shadowbox window and reloading the parent page.
Everything works fine if I do the login after the first click in the page. I can see that I'm logged in in the login_success.php page and after closing the window and reloading the parent page I'm still logged in
The problem starts if I do login as the first click: In this case I am logged in at login_success.php but after reloading the parent page, I'm logged out again. Same thing is with create account ofcourse too. This happens only if my first click on the page is "login"
The strange thing is, that I have the problem in firefox and safari but not in opera. I'm testing this all on a local Xampp installation. Thats why my beginning question. It looks to me like if in opera the session ID persist from click 0, in the other browsers it needs at least one click to start to persist. Recreating the session id in admin makes no differce
The code I use in login_success.php (and create account_success.php) and behaves as described is following: (the shopping cart related part works perfect)
<div class="pgconfot">
<?php
if (sizeof($navigation->snapshot) > 0) {
$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
$navigation->clear_snapshot();
?>
<div class="fltlft"><?php echo '<a onclick="parent.location.reload();parent.Shadowbox.close()">' . tep_image_button('button_continue_shopping.gif', IMAGE_BUTTON_CONTINUE_SHOPPING) . '</a>'; ?></div>
<div><?php echo '<a href="' . $origin_href . '"target="_parent"' . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></div>
<?php
} else {
?>
<div><?php echo '<a onclick="parent.location.reload();parent.Shadowbox.close()">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></div>
<?php
}
?>
</div> <!-- end pgconfot -->
I don't know if I'm right to suspect the browsers. Is there any way to "force" the session ID to persist before the first click? Or maybe I'm totally wrong in something?
Edited by multimixer, 19 November 2009 - 01:57 PM.