answersLogoWhite

0


Best Answer

Find your php.ini file (which holds all the settings for PHP, and how it should work).

Under the "sessions" section, find the directive "session.save_hander." Unless you're directed otherwise, and you want sessions enabled, this directive should be set to the string "files."

If session problems arise, find the directive "session.save_path," and make sure the current path it's set to actually exists (and that PHP can write to it). PHP does not create this directory; you need to.

Still not working? Go to the directory path that session files are saved in (as noted in the "session.save_path" directive) and see if there are session files being created when you start a session in a PHP script. If they are, then your scripts are most likely the problem. If the newly created sessions are empty, make sure that you are actually putting data in them, and that you're not resetting the $_SESSION global variable anywhere.

If they aren't, then it may help to reinstall PHP, or get further assistance elsewhere.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you enable PHP sessions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you use sessions in PHP?

Sessions in PHP are easy to learn and set up, first of all you need to make sure you use the function session_start() at the start of each script to make sure the sessions work. Then all you need to do is the following to store information in sessions: <?php // allow sessions to work on script session_start(); // set up a session called my number $_SESSION['my_number'] = 1; ?> That's all you need to do to set up and store data in a session. Now if you want to delete a session you will need to use the unset() function like shown below: <?php unset($_SESSION['my_number']); ?> To destroy all sessions in one go you can call the session_destroy() function. This will save you some time. <?php session_destroy(); ?>


How do you enable dynamic loading in PHP?

To enable dynamic loading of extensions, set enable_dl option in php.ini to 1


What is the purpose of a PHP session?

A PHP session serves quite a few purposes. PHP sessions store data that the web application developer would like to have preserved across the different page loads.


How do you install PHP on a Mac?

First install a webserver such as apache.Then download and unpack the PHP source for Unix/Linux.Open apache's httpd.conf and enable the PHP5 module and specify the location of PHP. There should be sample lines to uncomment within this file


How do you update and delete data from PHP sessions?

To update/delete data from a session all you need to do is the following: <?php // to update the session, you just overwrite it like a normal variable $_SESSION['name'] = "pizza"; // to delete a sessions data you can do this $_SESSION['name'] = ""; ?>


How do you create a webmail application with PHP?

Creating a webmail application in PHP involves using the related POP3 or IMAP libraries to connect to the mail system and cookies/sessions to save authentication information.


What is a php session?

A PHP session is a concept where specific variables (and their respective values) are carried throughout a user's viewing of a PHP-driven website. These sessions can be initialized and continued using the session_start() function. The session values are stored in the $_SESSION global variable. For more information, see the php.net documentation of session functions.


What will enable users to do when using PHP Nuke?

PHP Nuke is a news publishing site. It was first released in 2009 as a free platform with the General Public License but later releases require the purchase of a license fee.


Which line of code do you add to your webconfig file to enable sessions without cookies in aspnet?

<sessionState cookieless="true" />


What should you do to enable image functions in PHP?

Image creating and manipulating in PHP can be done with multiple libraries, some officially supported by PHP and some made by third parties. A common library, especially for developers new to image libraries, is the GD package. You must include the library you wish to use upon installation of PHP (if it is officially supported), or manually include the library into your scripts.


How do you design a website to display articles using PHP and MySQL?

sitepoint.com has tons of articles on PHP and MySQL I've read this book http://www.sitepoint.com/books/phpmysql1/ "While this is essentially a beginners book, it also covers more advanced topics such as the storage of binary data in MySQL, and cookies and sessions in PHP." The fourth edition arrives in June.


How do you support PHP on a web server?

contact your service provider and ask them to enable it on your account for shared hosting and if its a dedicated server you will need to edit your apache files to load to php module and reload and restart apache hope this helps :D