Sort: Rank

What Is a Session
What Is a Session? - PHP Script Tips - Understanding and Using Sessions A session is a logical object created by the PHP engine to allow you to preserve data across subsequent HTTP requests. There is only one session object available to your PHP scripts at any time. Data saved to the session by a sc...
2007-04-19, 4796👍, 0💬

How To Turn On the Session Support
How To Turn On the Session Support? - PHP Script Tips - Understanding and Using Sessions The session support can be turned on automatically at the site level, or manually in each PHP page script: Turning on session support automatically at the site level: Set session.auto_start = 1 in php.ini. Turni...
2007-04-18, 4835👍, 0💬

How To Save Values to the Current Session
How To Save Values to the Current Session? - PHP Script Tips - Understanding and Using Sessions When session is turned on, a session will be automatically created for you by the PHP engine. If you want to save any values to the session, you can use the pre-defined associative array called $_SESSION....
2007-04-18, 5019👍, 0💬

How To Retrieve Values from the Current Session
How To Retrieve Values from the Current Session? - PHP Script Tips - Understanding and Using Sessions If you know some values have been saved in the session by an other script requested by the same visitor, you can retrieve those values back by using the pre-defined associative array called $_SESSIO...
2007-04-18, 4848👍, 0💬

What Is a Session ID
What Is a Session ID? - PHP Script Tips - Understanding and Using Sessions A session ID is an identification string of a session. Since there might be multiple visitors coming to your Web site at the same time, the PHP engine needs to maintain multiple sessions concurrently. Session IDs are created ...
2007-04-18, 4884👍, 0💬

How To Retrieve the Session ID of the Current Session
How To Retrieve the Session ID of the Current Session? - PHP Script Tips - Understanding and Using Sessions Normally, you don't need to know the session ID of the current session. But if you are interested to know the session ID created by the PHP engine, there are two ways to get it: Calling sessio...
2007-04-18, 4787👍, 0💬

What Are the Options to Transfer Session IDs
What Are the Options to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions Once a new session is created, its session ID must be transferred to the client browser and included in the next client request, so that the PHP engine can find the same session created by the same vis...
2007-04-18, 4887👍, 0💬

How Session IDs Are Transferred on Your Web Server
How Session IDs Are Transferred on Your Web Server? - PHP Script Tips - Understanding and Using Sessions As you know there are two options the PHP engine can use to transfer session IDs to the client browsers. But how to do know which option is your PHP engine is using? The PHP sample script will he...
2007-04-18, 4874👍, 0💬

How To Force the PHP Engine to Use Cookies to Transfer Session IDs
How To Force the PHP Engine to Use Cookies to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions If you want to force your PHP engine to use cookies to transfer session IDs instead of URL parameters, you can open the PHP configuration file, php.ini, and make the following cha...
2007-04-18, 5092👍, 0💬

Where Are the Session Values Stored
Where Are the Session Values Stored? - PHP Script Tips - Understanding and Using Sessions When a value is saved into the current session by one PHP page, the PHP engine must stored this value somewhere on Web server, so that the PHP engine can retrieve it back when same visitor comes back to request...
2007-04-18, 4954👍, 0💬

What Is the Timeout Period on Session Values
What Is the Timeout Period on Session Values? - PHP Script Tips - Understanding and Using Sessions The PHP engine has no direct settings on session timeout period. But it has a session garbage collection mechanism that you can set to remove those special files containing session values. There are 3 ...
2007-04-18, 5193👍, 0💬

How To Test the Session Garbage Collection Process
How To Test the Session Garbage Collection Process? - PHP Script Tips - Understanding and Using Sessions In order to test the session garbage collection process, you need to change the settings to expire session variables in 10 seconds and run the process on every request: session.gc_probability = 1...
2007-04-18, 5017👍, 0💬

How To Set session.gc_divisor Properly
How To Set session.gc_divisor Properly? - PHP Script Tips - Understanding and Using Sessions As you know that session.gc_divisor is the frequency of when the session garbage collection process will be executed. You should set this value based on the income request traffic. Here are some suggestions:...
2007-04-18, 7514👍, 0💬

How To Set session.gc_maxlifetime Properly
How To Set session.gc_maxlifetime Properly? - PHP Script Tips - Understanding and Using Sessions As you know that session.gc_maxlifetime is the session value timeout period. You should set this value based on the usage pattern of your visitors. Here are some suggestions: # Set it to 20 minutes for a...
2007-04-18, 6790👍, 0💬

How To Tell If a Session Is New
How To Tell If a Session Is New? - PHP Script Tips - Understanding and Using Sessions There is not direct way to tell if a session is new or old. But you can design your site to have a required session value in all sessions. Then you can check the existence of this value in a session to determine if...
2007-04-17, 5127👍, 0💬

How To Remove Values Saved in the Current Session
How To Remove Values Saved in the Current Session? - PHP Script Tips - Understanding and Using Sessions If you want to remove values saved in the current session, you should use the unset() function on those saved values in $_SESSION, or use array() to empty $_SESSION: unset($_SESSION['MyColor']) - ...
2007-04-17, 4946👍, 0💬

How To Close a Session Properly
How To Close a Session Properly? - PHP Script Tips - Understanding and Using Sessions Let's say you site requires users to login. When a logged in user clicks the logout button, you need to close the session associated with this user properly in 3 steps: Remove all session values with $_SESSION = ar...
2007-04-17, 4896👍, 0💬

Is It More Secure to Use Cookies to Transfer Session IDs
Is It More Secure to Use Cookies to Transfer Session IDs? - PHP Script Tips - Understanding and Using Sessions Is it more secure to use cookies to transfer session IDs? The answer is yes, because attacking your Web site using URL parameters is much easier than using cookies. So if you are the system...
2007-04-17, 4719👍, 0💬

What Is session_register()
What Is session_register()? - PHP Script Tips - Understanding and Using Sessions session_register() is old function that registers global variables into the current session. You should stop using session_register() and use array $_SESSION to save values into the current session now.
2007-04-14, 5373👍, 0💬

  Sort: Rank