Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
pnSession.php Multisites question
  • Posted: 04.09.2002, 15:03
     
    istrigo
    rank:
    Freshman Freshman
    registered:
     December 1969
    Status:
    offline
    last visit:
    19.10.04
    Posts:
    30
    Hi fellow Nukers

    I have question regarding pnSession.php and Multisites.

    Problem:
    Cause I cannot run multisites (point specific subdomain on root domain dir), I did following:
    I created normal subdomain via CP and installed there new copy of PostNuke, sharing same DB and tables from main site, adding some new tables and hacking pntables.php (changing few prefixes to point PostNuke copy to some other tables specific for subdomain site).

    Now lets come to my problem:
    If I login as user at subdomain site and go on main domain, I am not logged there and if I logon on main site and go on subdomain site, I am not logged there as user.

    Users, session and other global PostNuke mysql tables are shared between this two sites (main site and subdomain site)

    What I read now in pnSession.php is line:

    [php:1:cd295e96a0][/php:1:cd295e96a0]

    Now, is there possiblity to allow login (cookie) to be valid on all sites on specific IP address (I have static IP) or list of hostnames, and how that be done?

    Once again .. I am not using classic Multisites. I have separate installations on subdomain and main domain sharing same mysql tables!


    Thanks in advance


    Ivan
  • Posted: 04.09.2002, 16:20
     
    jasho
    rank:
    Freshman Freshman
    registered:
     August 2002
    Status:
    offline
    last visit:
    04.01.03
    Posts:
    35
    ---------------------------------------------------------
    //after
    $host = preg_replace('/:.*/', '', $host);
    //write this:
    //hack by jasho
    $urlparts=explode(".",$host);
    $topleveldomain=array_pop($urlparts);
    $host=array_pop($urlparts).".".$topleveldomain;
    //and where you set cookie domain :
    ini_set('session.cookie_domain', $host);
    --------------------------------------------------------
    this makes you have the same cookie_domain for all of your multisites
    and you remain logged in.

    i made it and it works
  • Posted: 04.09.2002, 16:30
     
    istrigo
    rank:
    Freshman Freshman
    registered:
     December 1969
    Status:
    offline
    last visit:
    19.10.04
    Posts:
    30
    Awesome ....

    your hack works :P :wink:

    thanks a lot

    Bye

    Ivan

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula