Skip to content
Advertisement

Tag: cookies

Is session.cookie_secure in php.ini automatic?

Simple answer requested: If I put in the php.ini file for my website, will that automatically turn all the php cookies to secure and httponly, or will I still need to put in true, true into parameter slots 6 and 7 in the cookie itself? Answer The answer is yes. Setting this in php.ini is enough (however, I only saw

Turning YII_CSRF_TOKEN secure flag on

I have enabled CSRF Validation in Yii: ‘enableCsrfValidation’ => true, Everything works as expected however I’d like for the session cookie to have the secure flag turned on. With other cookies you can set the secure flag in the config: How do you do this for the YII_CSRF_TOKEN? Answer You can’t do that with the built in CHttpRequest component. You

PHP sessions don’t expire. Ever

I’m transferring my application to another server, but I have some issues with the PHP sessions that don’t seem to expire. In php.ini I’ve set: Cookies are enabled, of course. And still, after 5 minutes, if I refresh the page I’m still logged in. Even if I close the browser and reopen the page. Edit: actually, it seems that closing

How to delete cookie on codeigniter

I don’t know how to delete a cookie. I want is when I submit a form. The cookie is also delete. I try the delete_cookie(“name”) but is not working. I think because the cookie I created by javascript. Please check my code to fix this problem. This is my sample text field: and this is the javascript Answer Using Codeigniter,

Can cookie values be set after html has loaded on a page?

I read that cookie values can be set after HTML content has been sent from a PHP script to the web server. However, when working with this, I have not been able to set the cookies as I had hoped. Can someone straighten out my discrepancy? Answer PHP can only set cookies while sending the headers of the page (that

Check if a PHP cookie exists and if not set its value

I am working on a multilingual site so I tried this approach: The idea is that if the client doesn’t have an lg cookie (it is, therefore, the first time they’ve visited this site) then set a cookie lg = ro for that user. Everything works fine except that if I enter this page for the first time, the first

Advertisement