Forum

Thread tagged as: Question, Members

Cookies from 'Members' login

Hi there

I was wondering how long the cookie lasts for 'Members' app logins, and how you would go about increasing it?

Thanks

Rich

Rich Hemery

Rich Hemery 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

By default it's set to 5 days. You can change it in your config.php file. Fro example:

define('PERCH_MEMBERS_SESSION_TIME', '10 DAYS');

Hi Drew

I changed this from 5 days to 30 days ages ago. However, it doesn't seem to work so I was wondering if there was anything else I needed to do?

I have inspected the cookies and it looks like there is one for 30 days like I've set, but it's only for the / directory. I think therefore that it's not 'working' at the moment because the /offers folder where you need to be logged in to is still saying 'when the browsing session ends'.

Please see screenshot for details: https://s28.postimg.org/aikyqmm97/cookies.jpg

The website in question is www.lovebedfordoffers.co.uk

Thanks

Drew McLellan

Drew McLellan 2638 points
Perch Support

A directory of / covers anything below that point.

Oh right, I see!

Perhaps the other cookie is overwriting it as currently it does not last 30 days, no where near :(

Drew McLellan

Drew McLellan 2638 points
Perch Support

Which other cookie?

On my screenshot https://s28.postimg.org/aikyqmm97/cookies.jpg

It looks like two cookies? I know nothing about this so I could be completely wrong but... one that I've set to be 30 days which looks like it should be working (on the right).

And then one on the left which says it expires when the session is over?

Drew McLellan

Drew McLellan 2638 points
Perch Support

cmsa is the control panel cookie used for things like Ctrl-E to edit.

p_m is the Perch Members cookie.

Oh right, excuse my ignorance, I just thought it was a coincidence that I had set it to 30 days for the members cookie and that's what the cmsa was saying for its cookie length.

I've just checked the p_m cookie and it has 'when session ends' as its duration. Have attached a screenshot showing my config file too for info: https://s11.postimg.org/l59t3z8ky/cookies2.jpg

Regards

Drew McLellan

Drew McLellan 2638 points
Perch Support

In which case that could be a bug. We'll take a look at it.

Thanks Drew.

Would any other Perch developers be able to assist here?

I am happy to reward any solution.

Regards

Rich

Drew McLellan

Drew McLellan 2638 points
Perch Support

I've made some changes for the next release which I hope might help.

Ah, that's good news. Thanks.