Page 1 of 1

Setting permanent logins in php.ini?

Posted: Sat Apr 09, 2005 5:11 pm
by theotheragentm
First, I would like to preface this post by saying I don't know how php.ini works. I tried reading the php.net documentation, but now my head just hurts.

When I go to my site in Internet Explorer 6, the site is asking me if I want to set a cookie when I log into the page, but in my temporary files, I don't see the cookie. When I use Mozilla Firefox, I see the cookie and it says it expires at the end of the session. So, I am getting a cookie on both browsers, but perhaps IE doesn't show session variables?

1. My page is handing out the cookie, right?
2. Can I set a php.ini, so the cookie stays permanent?
3. If php.ini is not the way to go, is there a way I can accomplish it?

Thanks in advance for any help.

Posted: Sat Apr 09, 2005 5:16 pm
by Chris Corbyn
It's not php.ini.... that's just your php configuration.

You must be getting the prompt becuase you have your IE security level to ask before accepting cookies.

Somebody else has just asked about cookies not being visible in IE :?

Anyway, if you dont want the session to expire you have a (at least) two options:

a) Use $_COOKIES instead of sessions (this way you can set the expiration time).
b) Store the session data in a database and retreive it at the start of the next session (search on this forum for "saving sessions in mysql")

Posted: Sat Apr 09, 2005 8:08 pm
by theotheragentm
Thanks for your response. What it turned out to be is that my server is running PHP as CGI under SuExec environment. The .htaccess file that came with the engine I was using to manage my content cannot set the PHP variables. I was able to put it in a php.ini file.