Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'session_id()'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hello all, I have found this forum a fantastic compliment to a very good book. Both have helped me numerous times to find solutions as I have learnt more about PHP and MYSQL. Alas, there is one question I cannot find help on... I am in the middle of Chapter 16. After completing index.php in script # 16.5 I came across a problem whereby my browser is still recognising the session_id from the forum website built in Chapter 15 and as a result my code encounters an error when trying to execute the following code in the footer.html (script # 16.2): // Add links if the user is an administrator: if ($_SESSION['user_level'] == 1) { echo '<a href="view_users.php" title="View All Users">View All Users</a><br /> <a href="#">Some Admin Page</a>'; } Please correct me if I am wrong, but I believe this is because I had not closed the browser after finishing chapter 15 so the browser still had a session_id() saved in the PHPSESSID cookie. Therefore, session_start() was not executed when the header.html (script # 16.1) was called from index.php (script # 16.5). I was able to quickly resolve this without closing the browser by running a page with $_SESSION = array(); which deleted the previous saved session. I know there is a more thorough way to remove all trace of a previous saved session in the "Tips" section on page 356. Below is a snippet of the error code returned in my browser before I made the fix, as you can see the _SESSION array is returning the session variables stored from running index.php in Chapter 15. Error code: [_SESSION] => Array ( [user_id] => 1 [user_tz] => America/New_York [lid] => 1 ) Regardless, for me it raised a more important question that is: Because session_start() works by creating a session file on the server should you only load one website on one server at one time? Or can you run multiple websites on one server at the same time? If so, do any of you know how to get round the issue of your different websites using the same session data? So that in theory I could run the website created in Chapter 15 at the same time as Chapter 16 but not have any conflict between their session data? Any pointers or advice would be greatly appreciated. Kind regards Pejowh
×
×
  • Create New...