Re: Domain Redirect - loses session variables



I purchased this Domain from DirectNic and they have the option to redirect
with no frame which works like a charm. What it does is put the redirected
address in the address bar so it appears to be coming from the same domain
name. Session variables are saved and it works great! Don't have to make
any changes to the app.


Vic



"Andy Hassall" <andy@xxxxxxxxxxx> wrote in message
news:piqik11kbksse3ci0a29og0515jhgabfir@xxxxxxxxxx
> On 9 Oct 2005 10:40:11 -0700, "Chung Leong" <chernyshevsky@xxxxxxxxxxx>
> wrote:
>
>>Andy Hassall wrote:
>>> If you want this to work, you'd need a method of migrating the session
>>> data
>>> from one domain to the other through some shared data storage.
>>
>>I think you might have misunderstood the situation described by the OP.
>>He said he had purchased a new domain name. Presumbly, the name points
>>to the same machine. Unless the web server is set up to have different
>>session save-path per virtual host, session data are shared by default.
>>In any event, I believe you can override the save-path with ini_set().
>
> In that case he already has the shared data storage.
>
>>The problem here is that cookies--hence session ids--don't travel
>>across domains. So you need to manually sync the cookies of the two
>>domains. One way to do this is to do a round-trip redirection at the
>>very beginning. From domain_1, redirect to a page on domain_2 with the
>>session id passed on the URL. This page calls session_id($_GET['SID'])
>>and session_start(), then redirect back to the original page in
>>domain_1. Now both domains will use the same session id. A simpler way
>>is to use an invisible inner frame to initialize the cookie in
>>domain_2.
>
> Since the shared data storage is the same PHP session data area, then this
> is
> essentially just a simpler case of what I said - the unique ID passed to
> get at
> the shared data is already the session ID.
> --
> Andy Hassall :: andy@xxxxxxxxxxx :: http://www.andyh.co.uk
> http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool


.



Relevant Pages

  • Help Needed: Cant Successfully Perform Server-side Redirection
    ... The only problem that I really have is session timeouts. ... situations and redirect the user to the Logon page. ... If Not IsLogonPage And Not IsLogOffPage Then ... Dim ExpirationInterval As Integer = Settings.TimeoutMinutes ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: session value lost
    ... >into as sessionvariable (username). ... So I redirect to my search.aspx. ... >I save the recordid to the session and redirect to work.aspx. ... >new sqlstring I fetch the data from the sqlserver. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: NoAccessAllowed.aspx
    ... Set a low cache time in your page to ensure it does not cache for long on ... > the user clicks the BACK browser button after the session has expired? ... How do you know to redirect them? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Losing Session vars on Redirect - HELP
    ... Have you checked the event log to make sure something in the redirect isn't ... causing the site to crash and therefore restart the ASP.NET worker process / ... starts a new session, but about 20% its just fine. ... Overriding the browsers cookie ...
    (microsoft.public.dotnet.general)
  • Re: Domain Redirect - loses session variables
    ... > If you want this to work, you'd need a method of migrating the session ... > from one domain to the other through some shared data storage. ... > mark this with a unique identifier, and pass that ID as a parameter across ...
    (comp.lang.php)