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 5968379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:04:53+00:00 2026-05-22T20:04:53+00:00

PHP puts the session id into the URL when cookies are turned off. Does

  • 0

PHP puts the session id into the URL when cookies are turned off. Does this session id have to be accounted for (by proactively coding for it) in the case where .htaccess rewrite is being used?

Also, I presume that when cookies are off the session id cannot be propagated automatically when there are a mix of .php files and .html being served. That is, if a user navigates to an .html page from a .php page and then back to .php page, the session id is lost as the .html file cannot account for it. Is this correct?

  • 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-05-22T20:04:54+00:00Added an answer on May 22, 2026 at 8:04 pm

    In most cases the session ID does not figure in .htaccess processing because it is in the QUERY_STRING part of the URL (that is, after a ?). But you might have to account for it if you test QUERY_STRING in a RewriteCond or replace it in a RewriteRule.

    And you presume correctly, the session ID will not propagate through a pure HTML file. However, you could use .htaccess to run .html files through PHP:

    AddType application/x-httpd-php .html
    

    and something like this to activate the URL rewriting feature for those files:

    <FilesMatch "\.html$">
        php_value auto_prepend_file "/home/*******/public_html/session_start.php"
    </FilesMatch>
    

    where session_start.php contains just:

    <?php session_start();
    

    (See this SO question for details).

    Or you could just put up an error page telling users that you don’t support running with cookies off.

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

Sidebar

Related Questions

I have this function that puts some data with Ajax call in a php
I have this code, which uses ob_start php function. Which basically puts the echoed
I have a bunch of PHP code that is auto-generated and it puts all
I have a PHP function which takes a passed url and creates a clean
I have a PHP program that has the user copying a URI into a
I'm using a PHP form to put values into a table I have. Everything
I am developing a php MVC framework from scratch and have run into an
I am currently working on a PHP application that puts me in the desperate
PHP, as we all know is very loosely typed. The language does not require
PHP stores its session information on the file system of the host of the

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.