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!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
How do i set persistent session using PHPSESSID?
I have written following code:
In above code I am setting the PHPSESSID expiry limit for 1 year. But if i again come and access the same page the else part gets executed and on session_start() the PHPSESSID expiry date again replaces according to php.ini settings.
if i comment session_start() in else part everything works fine, but i can't set or access session data.
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I doubt you'll get a session to last a year... even when it's configured in the php.ini file for your session's lifetime to last that long. But who knows, you may. I've never heard of anyone trying it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.