On Thursday 14 October 2004 17:35, Graham Cossey wrote:

> A user logs in to my 'site' (script1.php) and I store relevant details in a
> session, all fine. I redirect to another page (script2.php) which checks
> and retrieves certain session values, all fine. My problem is with
> script3.php which happens to be within an iframe in script2.php. When the
> user is automatically passed to that page, from log in, the session details
> are not available but if the user makes a (menu) selection the session
> values are available to script3.php within the iframe. help !
>
> Simplified code:
>
> script1.php
> <?php
>   session_start();
>   [some code]
>   $_SESSION['user'] = $_POST['user'];
>   [some code]
>   $hdr = "Location: script2.php?".SID;
>   header($hdr);
> ?>

Use an absolute URL for header redirects.

You're passing the session id (SID) onto script2 but not to script3, if that's 
the only method by which you're propagating the session id then script3 is 
not going to have a session.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
I appoint you ambassador to Fantasy Island!!!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to