Hi,

Im using session variables and when passing from one page to another with a target="_top" the session variables are erased.
Is there anyway i can go around this problem ?
Any idea will be greatly appreciated.

Thank you

Recommended Answers

All 3 Replies

I just created a couple little test pages and the $_SESSION passed fine.

session.php

<?php
session_start();
$_SESSION['test']=TRUE;
var_dump($_SESSION);
?>
<br />
<a href="sessiontop.php" target="_TOP">sessiontop</a>

sessiontop.php

<?php
session_start();
var_dump($_SESSION);

Yes, ive tested your code too and it worked.
maybe it's because i'm using <form ... action="_top"> and a normal submit

when i use that it doesnt work but if i take the _top out, it works, and the session variables are preserved.

I already know what was wrong, it had nothing to do with the target=_top or not,
i had a bug because in javascript i had <script type="text/jscript">
instead of <script type="text/javascript">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.