session_start() and code snippets
I have a beginner's knowledge of PHP and it's served me well enough to-date. I'm trying to now consolidate code and use more includes and requires in order to eliminate duplicate code. I'm looking for clarification on the use of the session_start() function.
My current project includes a few forms and emails formatted form data to a given email address. I've used the $_SESSION array to store data as I move from input page to processing the input for issues and then mailing formatted data. There is no login or other process through which I track or manipulate any session IDs.
As I remove as much code duplication as possible, I run into code sections that don't seem to have any need for current session information. I'm just setting variables, etc. and don't access any $_SESSION array values or those of any others for that matter.
Do I need to start those code snippets with session_start()? Or only those code snippets that access $_SESSION?
Also, does calling the session_start() function frequently potentially create a performance problem as seems implied in some information I've found while researching this question?
Thank you for any constructive insight here!
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread