Jump to:

4975 Posts in 14338 Topics by 1492 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » session.use_cookies=Off

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 1691 Views
  • logiciel
    Avatar
    Community Member
    2 Posts

    session.use_cookies=Off Link to this post

    We have developed a Silverstripe site on a local server, this works fine.
    But on the live server we get problems with login, with creating of Redirector page, with staying logged in, with uploading of images in ImageGallery etc.
    Some live server settings are not standard, for example

    session.use_cookies=Off ;
    session.use_trans_sid=1;
    session.name is not PHPSESSID

    I think the session.use_cookies makes the troubles and must be set to On.
    Do I have right?
    Can Silverstripe properly work with session.use_cookies=off?

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: session.use_cookies=Off Link to this post

    I'm not sure this will work, but you could try adding this to the top of sapphire/core/Core.php just underneath the <?php tag:

    ini_set('session.use_cookies', '1');
    ini_set('session.use_trans_sid', '0');
    ini_set('session.name', 'PHPSESSID');

    If that doesn't work, add this to the .htaccess file instead:

    php_value session.use_cookies 1
    php_value session.use_trans_sid 0
    php_value session.name PHPSESSID

    Sean

  • logiciel
    Avatar
    Community Member
    2 Posts

    Re: session.use_cookies=Off Link to this post

    Thank you, I have already tested with ini_set('session.use_cookies', '1') in mysite/_config.php, it seems to work.
    The setting session.use_cookies=1 is not mentioned in silverstripe documentation as required, therefore I have asked.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: session.use_cookies=Off Link to this post

    It's not mentioned, but there are certain PHP configuration options we miss out. I don't believe it's common to disable cookies for sessions, hence why we haven't discovered this until you raised the issue. Paranoid web host?

    1691 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.