Jump to content

Change path to cookies


Tom S.

Recommended Posts

Posted

Currently the cookies set by the IPS suite are being stored with a path matching the suite location.

So for example, if the IPS suite is at mysite.com/forums/, the path to the cookies is '/forums'.

This means I cannot access these cookies from a different location of the website. How can I change the path of the cookie locations set by the suite to just '/'?

 

Posted

I've not personally tried this however you should be able to set this via a constants.php file. Bear in mind I'm not a dev although this may assist hopefully:

https://invisioncommunity.com/4guides/advanced-options/configuration-options/using-constantsphp-r25/

One or more of these in it...

define( 'COOKIE_DOMAIN', " put required data here ");
define( 'COOKIE_PREFIX', " put required data here ");
define( 'COOKIE_PATH', " put required data here ");

Don't forget the opening <?php line if its a new constants.php file. :)

By default prefix is usually set to "ips4_" as defined in init.php, the other two are set to null according to said file.

Posted
15 hours ago, AndyF said:

I've not personally tried this however you should be able to set this via a constants.php file. Bear in mind I'm not a dev although this may assist hopefully:

https://invisioncommunity.com/4guides/advanced-options/configuration-options/using-constantsphp-r25/

One or more of these in it...


define( 'COOKIE_DOMAIN', " put required data here ");
define( 'COOKIE_PREFIX', " put required data here ");
define( 'COOKIE_PATH', " put required data here ");

Don't forget the opening <?php line if its a new constants.php file. :)

By default prefix is usually set to "ips4_" as defined in init.php, the other two are set to null according to said file.

Hi, I'm having an issue where the cookies are being deleted when the browser is closed.

So, every time I visit the site after re-opening the browser I have to login again.

When I check the cookie "ips4_member_id" it shows:

Quote
Created
Monday, 4 September 2017 at 12:39:57
Expires
Monday, 4 December 2017 at 11:39:57

So why does it disappear when the browser is closed?

EDIT:

I can see that actually, the cookie is not deleted when the browser is closed. It's deleted when I visit the site after having reopened the browser. Something is clearing the cookies when I visit my IPS site. What could be causing this?

 

EDIT 2:

I wiped all the cookies and tried again. Seems to work fine now. so maybe some old cookies from the previous path where causing some conflicting issues.

All good for now :)

Posted

You're welcome. :)

Yes its a good / sensible idea I think to clear the browser cache / existing cookies out if practical after making a change like this, at least that way you can be sure its OK or not. An alternative would be to temporarily use a different browser to determine if a problem was cookie related or not, but I see you've solved it all for now anyway.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...