Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8525301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:56:19+00:00 2026-06-11T07:56:19+00:00

If I have 3 php scripts (Text1.php, Text2.php and Text3.php), when I use session_save_path(),

  • 0

If I have 3 php scripts (Text1.php, Text2.php and Text3.php), when I use session_save_path(), is it better if all the session details are saved into one file or should it be saved in seperate files?

In other words does the code below go into Text1.php, Text2.php and Text3.php:

session_save_path("helios.hud.ac.uk/u09999999/Computer_app/sessionData.php");

OR

should it be Text1.php:

session_save_path("helios.hud.ac.uk/u09999999/Computer_app/sessionData1.php");

Text2.php

session_save_path("helios.hud.ac.uk/u09999999/Computer_app/sessionData2.php");

Text3.php

session_save_path("helios.hud.ac.uk/u09999999/Computer_app/sessionData3.php");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:56:21+00:00Added an answer on June 11, 2026 at 7:56 am

    You’ll need to have all three scripts use the same path if you want them to share session data, which is kinda the point of sessions.

    Also, session_save_path() sets the name of the directory to use, not the name of the file. PHP will determine the file name.

    So use one value for all scripts:

    session_save_path('/path/to/session/data/directory');
    

    Or better, set it in an init script that gets included from each script:

    init.php:
        session_save_path('/path/to/session/data/directory');
    
    text1.php:
        require_once 'init.php';
    

    Edit: Also, make sure that the directory can be written to by the process that runs the web server. And note that you may also set this value globally by editing the appropriate line in your php.ini, wherever that may be stored on your particular system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form in a PHP script and one text field. However when
I have php scripts that do things like register, login, upload. I would like
I have a directory of PHP scripts ( mainly utilities), that is located on
I have a folder of PHP scripts, they are mostly utility scripts. How to
I have a series of PHP scripts that I want to run in a
I have a collection of PHP scripts that are extremely CPU intensive, juggling millions
I have the following two php scripts remove_directory.php <?php start_session(); $userId = $_SESSION['userId']; exec(escapeshellcmd(rm
I want to pass a variable javascript into variable php. I can't use $_GET
I now have a working JSON formatted file from my PHP scripts. The next
I have a PHP file which writes some information into a configuration file which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.