Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default What you think is causing this...

    I has a page and its located at

    a: http://www.mypage.com/status.php

    and I have another page

    b: http://mypage.com/status.php

    when I login on my login page

    aa: http://www.mypage.com/login.php

    page a:

    http://www.mypage.com/status.php

    says "logged in" (quote) however page b

    http://mypage.com/status.php says "not logged in" (quote)

    But if i login page bb

    http://mypage.com/login.php

    page b then says "logged in" (quote)

    Both yes, use the same code (they're exactly the same page without www [vice-versa])

    The code on the following "Status" page is this:

    PHP Code:
    <?php require_once 'Includes/Core.inc.php';

    if( 
    $Core->Users->Logged_In() )
    {
        echo 
    'logged in';
    }
    else
    {
        echo 
    'not logged in';
    }
    Now what do you think is causing this occurrence? Some setting I haven't set right or something?

    - Thanks in advance

    James
    Hi, names James. I am a web developer.

  2. #2
    Join Date
    Jun 2008
    Location
    Manchester
    Posts
    766
    Tokens
    0

    Default

    It's something to do with how the cookie's are set rather than the script to detect status.

    Many websites redirect if the url doesn't begin with www..
    Last edited by Jxhn; 19-04-2009 at 01:47 PM.

  3. #3
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Yet Im not even using cookies at that point, its using a PHP session to check against a database.

    I can fix the problem like you said but its the issue that im using flash to check Page.php and I rather not place a url in that like http://www.mypage.com/Page.php

    I used the following code on my other hosting account (With cpanel etc) now im just using barebones VPS with LXadmin installed for apache/mail/etc

    I was just guessing it was a setting that had to be set.

    I'll go through the PHP/Apache settings and see what I find
    Hi, names James. I am a web developer.

  4. #4
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Do u need to start sessions?


  5. #5
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    No thats init in the core.

    SebastianJu
    21-Aug-2008 08:41 Cant believe this problem isnt described herein. I wondered why my session-variables lost their values when going from first site to second site. Both had a session_start();.

    A session is working only on one domain. Subdomains dont use the Session of the maindomain. That means if someone comes to your site at yourdomain.com and the session is started there and then clicks a link where he is lead to www.yourdomain.com then the old session isnt working there anymore. Because www. is a subdomain.

    In the practice that will mean a lot of lost sessions only because webmasters dont know this behaviour. I have never read a word about this in manuals or somewhere...

    The solution is to put this code before the first session_start();

    ini_set("session.cookie_domain",substr($_SERVER[HTTP_HOST],3));

    Now it works. At the second place of parameters has to come in ".yourdomain.com" (with a dot before). With that the subdomains will use the same session like the maindomain. In this example domainname taken from Server-variable.

    Greetings!
    Sebastian
    Last edited by Protege; 19-04-2009 at 02:18 PM.
    Hi, names James. I am a web developer.

  6. #6
    Join Date
    Mar 2008
    Location
    Swindon, UK
    Posts
    1,274
    Tokens
    187
    Habbo
    :Ltd

    Latest Awards:

    Default

    Fixed it with apache , now ive got to some how piggy back the session data the browser uses so flash is "logged in" oh fun

    Thanks anyway.
    Hi, names James. I am a web developer.

  7. #7

    Default

    I think it's .htaccess

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.mypage\.com [nc]
    RewriteRule ^(.*)$ http://www.mypage.com/$1 [R=301,L

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •