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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:23:04+00:00 2026-06-06T08:23:04+00:00

For starters, we’re using the Yii framework to create our sites and it is

  • 0

For starters, we’re using the Yii framework to create our sites and it is handling the creation of the cookies.

We have a site with many subdomains so the main site has a session cookieParams of “.sitename.com”.

Something like this:

  • http://www.sitename.com
  • a.sitename.com
  • b.sitename.com
  • admin.sitename.com

We have www, a, and b to share the same session cookie and this works great.

However, we have one special admin subdomain that has a different user system and login mechanism, so we have a separate session cookieParam of “admin.sitename.com”.

The problem is, if someone gets a session cookie from the main site, logging into the admin site fails, because the main site’s “.sitename.com” cookie appears to be taking precedence. Deleting the cookie for the main site fixes the issue temporarily until the browser visits the main site again.

Is there any way around this, or is there a better way to set the cookies domain?

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-06-06T08:23:05+00:00Added an answer on June 6, 2026 at 8:23 am

    After ispecting how yii accomplishes this with their gii tool I set the following in my config.php and got it working.

    <?php 
    
    $config = array(
        ...
        'components'=>array(
            ...
            'user'=>array(
                // enable cookie-based authentication
                'allowAutoLogin'=>true,
                'class' => 'WebUser',
                // Create a custom key prefix for the user cookie
                'stateKeyPrefix'=>'customkey',
            ),
            ...
            'session' => array (
                // Provide a custom name for the session id to differentiate it 
                // from the default PHPSESSID
                // Cannot use dots in the session id :(
                'sessionName' => 'custom_session_id',
                // Keep session stored in db for use accross load balancer
                'class' => 'system.web.CDbHttpSession',
                'connectionID' => 'db',
            ),
            ...
        ),
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, a few things I'm not quite sure about. For starters: I have a
For starters I have whored myself out to the Internet in general as far
For starters I have checked out a couple of the other regex threads and
For starters, any help would be greatly appreciated! I have created a numerical keypad
For starters... I have no sinister intention of subjecting users to popups or anything
I'm looking into using the Mono framework for taking my current C# application cross-platform
We have a C# (winforms) application used for adding new starters to amongst other
Hello I want to create a dll with some functions. For starters I'm trying
I want to create my very first web app using HTML, MySQL, PHP and
For starters this is a homework question. I have an idea but I am

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.