Re: Session Data

From: Date: Fri, 21 Mar 2003 17:37:11 +0000
Subject: Re: Session Data
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-140616@lists.php.net to get a copy of this message
Are you using something like $_SERVER['HTTP_HOST'] or $_SERVER['PHP_SELF'] to get the base URL for the app when doing the redirect? If you have the whole URL typed in and switch from something like www.mydomain.com to mydomain.com, the browser may think it's a different site and loose the cookie with the session ID. HTH :) - Anthony "Tony Bibbs" <tony@tonybibbs.com> wrote in message news:Pine.LNX.4.44.0303211107400.22619-100000@internal.iowaoutdoors.org... > I'm wrapping up an MVC implementation for PHP. Everything is working > splendidly except that redirects seem to be loosing session data. Here is > the basic logic > > 1) on a form, user enters data hits submit > 2) data validates OK, data is saved and $_SESSION['MVC_message'] is set to > 'Save was successful' > 3) After setting session data in step 2 above, a redirect is issued: > header('Location: ' . $url); > 4) The URL represented by $url within same app doesn't have any data in > $_SESSION and I'm positive a session_destroy() isn't being called > explicitly. > > The ideas here is to show a page with context information for the user. > > Any ideas why this isn't working? > > -- > Tony Bibbs "I guess you have to remember that those who don't > tony@tonybibbs.com hunt or fish often see those of us who do as > harmlessly strange and sort of amusing. When you > think about it, that might be a fair assessment." > --Unknown > >

« previous php.general (#140616) next »