Page 1 of 1

Sessions used in Popup

Posted: Fri Aug 03, 2007 4:35 pm
by Smackie
Im trying to send sessions from site to popup and im not sure if i have the code right or not :S

here is the popup link im using

Code: Select all

<A HREF="javascript:popUp('http://mysite.com?sid=<?php echo session_id(); ?>')">Popup Window</A><br>
and here is the code thats put in the popup window

Code: Select all

<?php
session_id(strip_tags($_GET['sid']));
ob_start()
//and go on with your session vars
?>
now when i look at the top where the title is it shows that the sessions are going but still doesn't show the users name can someone hlep me here? please

Thank you
Smackie

sessions are not sent

Posted: Fri Aug 03, 2007 5:13 pm
by yacahuma
sessions are not sent like a GET variable l. The session is kept on the server so there is no need to send it. It is already there


just use $_SESSION['var'] and that it. checkoiut session on php.net os any session tutorial out there

Posted: Fri Aug 03, 2007 5:20 pm
by Smackie
i have it set up as $_SESSION['user_name']; but its in a popup and it doesn't get the users name so therefore the sessions is not going to the popup and when i was reading up on it at php.net someone said to use that method...