[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sitemanager-devel
Subject:    Re: Session aware redirection
From:       Shannon Weyrick <weyrick () roadsend ! com>
Date:       2002-02-07 17:32:56
[Download RAW message or body]

On Wednesday 06 February 2002 10:54 pm, Joel Grenon wrote:
> Hi,
>
> Is there an easy (and clean) way to redirect to another page and keep
> the session context? I haven't seen anything in SM_session. I plan to
> use the header("Location: url") function, but I can't find a way to
> construct the required URL. Does redirecting SM_session->PHP_SELF will
> keep the session context?
>
> Thanks,
>
> Joel

Hi Joel,

in 2.3.x (looks like that's what you're using?) the correct way to transfer 
is:

$this->sessionH->saveSessions();
header("Location: newPage.php?".$this->sessionH->getSessionVars());
exit;

you can of course add extra variables to the URL.

there's a global support function call SM_reloadPage that does something 
similiar to this right now, but it reloads the page instead of transferring 
to another page.

in any case, there's no reason there's not a wrapper method for this in 
SM_session, so I'm going to add one for the next release.

shannon
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic