Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:20:33+00:00 2026-05-25T14:20:33+00:00

I am working in a subfolder on my website: www.example.com/subfolder Now, i want to

  • 0

I am working in a subfolder on my website: http://www.example.com/subfolder

Now, i want to set a session that is only accessible within http://www.example.com/subfolder

To achieve this, i did the following:

private $sessiontimeout= 10800;
        private $subdomain = '/subfolder/';
        private $website = 'example.com';    

function __construct ($table)
            {print_r( $_SESSION );
                $this->table=$table;
                $this->savedusername= $this->getsession('logbook');
                session_set_cookie_params ( $this->sessiontimeout, $this->subdomain, $this->website, 0, 1 );
                ini_set('session.use_only_cookies', 1);
                if (!is_null ($this->savedusername))
                {
                    $resultobj=selectquery ("select last_login_one from $this->table where username=?", "s", (array) $this->savedusername);
                    if ($resultobj['obj']->num_rows() > 0)
                    {
                        $this->last_login=$resultobj['data'][0]['last_login_one'];
                    }
                }
            }

Now when i print the $_SESSION array, it does not display anything, Not even ‘Array()’.

Please what am i not doing right?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:20:33+00:00Added an answer on May 25, 2026 at 2:20 pm

    Have you used session_start() anywhere before that code ?

    I also suggest using var_dump() instead of print_r() to debug values as print_r doesn’t output null values, hence creating some confusion sometimes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with ASP.net. My website is hosted within a subfolder test under the
I have my website in a subfolder from the main root. www.domain.com ---redirects to--->
I'm using TortoiseSVN. I had previously been working with only one subfolder of a
I'm working on an ASP.NET website which targets desktop browsers. We want to enable
I am working in ubuntu, I have a folder that contains a subfolder. in
it's been a couple of hours now that I'm working on this and I
I'm working on a website that has a file management portion where users can
My website is in the root directory, which is /www.lebmotor.com/web/content/ . I am using
Working with a SqlCommand in C# I've created a query that contains a IN
Working on a project that parses a log of events, and then updates a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.