Setting permanent logins in php.ini?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
theotheragentm
Forum Newbie
Posts: 9
Joined: Tue Jun 25, 2002 2:38 pm

Setting permanent logins in php.ini?

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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")
theotheragentm
Forum Newbie
Posts: 9
Joined: Tue Jun 25, 2002 2:38 pm

Post 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.
Post Reply