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 6853125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:28:26+00:00 2026-05-27T01:28:26+00:00

There are 2 projects under my Apache public_html root. One is /project1 and the

  • 0

There are 2 projects under my Apache public_html root. One is “/project1” and the other is “/project2”. Project 2 is just duplicate of project 1 but with some modification to fit a different goal. They have the same core code, so the session names used are the same.

I initialize session this way for project 1:

ini_set("session.cookie_path","/project1");
session_name("sid");
session_start();

And very similar for project 2:

ini_set("session.cookie_path","/project2");
session_name("sid");
session_start();

The cookie paths are not equal, so even with the same cookie name (here is ‘sid’), PHP should be able to differentiate them.

But the fun is that when admin on project 1 logins, then the admin in project 2 is also interestingly logged in.

  • 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-27T01:28:26+00:00Added an answer on May 27, 2026 at 1:28 am

    Some browser don’t like cookies with path and without expiration, so you can add:

    ini_set('session.cookie_lifetime', 3600);
    

    The session cookie is sent only one time by PHP (if missing), then to force PHP to resend the cookie, with updated expiration time, after session_start() you can add:

    session_regenerate_id();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an open source project under Apache License 2.0. Normally, I would just
I'm working on a .NET 3.5 website, with three projects under one solution. I'm
There are two projects: 1) applet project that outputs jar file 2) web app
I'm working on one of those projects where there are a million better ways
Is that a problem if a solution contains many projects and there are some
There are some build systems that are able to generate platform specific project files
Recently I put my two C++ projects under one solution in VS 2010. One
Previously I was working on one django project under the domain of abc.com and
One of my projects was under SourceSafe and I am using VS2008. Recently I
I was wondering, why do we (Java community) need Apache Harmony project, while there

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.