Jump to:

5522 Posts in 1734 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Silverstripe CMS on a clustered server environment

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 236 Views
  • GraemeK
    Avatar
    Community Member
    3 Posts

    Silverstripe CMS on a clustered server environment Link to this post

    Hi

    I've built a silverstripe site which is being hosted on a distributed infrastructure. Now it's deployed for testing I'm having issues with maintaining Session states across the boxes.

    I've implemented memcache for the frontend stuff, and that is working well.

    However, when a user logs into the CMS their logged in status is not being maintained. I presume the stuff that handles this is using Session??

    Where can I switch the user authentication to instead use my Memcache server??

    Cheers!

  • Tim Snadden
    Avatar
    Community Member
    32 Posts

    Re: Silverstripe CMS on a clustered server environment Link to this post

    From memory I resolved what may be the same problem as follows (in mysite/_config.php).

       // If this is not set, the path in cookie will be empty and logins
       // will fail
       Session::set_cookie_path('/');
       Director::setBaseURL('/');

  • GraemeK
    Avatar
    Community Member
    3 Posts

    Re: Silverstripe CMS on a clustered server environment Link to this post

    Cheers!

    For reference, I solved this issue, by overriding the framework/security folder by copying it into mysite/ .

    I then did a find replace on all instances of Session::{function-name}, and replaced them with an appropriate Memcache function.

    I also had to instantiate the Memcache servers in Main.php.

    Fun times...

    But it works.

  • Tim Snadden
    Avatar
    Community Member
    32 Posts

    Re: Silverstripe CMS on a clustered server environment Link to this post

    I'm glad you got it solved. You may want to have a look at Object::useCustomClass(). That way you could use your own customised version of the Session class that makes use of memcached without having to hack the framework.

  • GraemeK
    Avatar
    Community Member
    3 Posts

    Re: Silverstripe CMS on a clustered server environment Link to this post

    Great stuff thanks! I'll check it out.

    236 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.