Forum Moderators: coopster

Message Too Old, No Replies

How to avoid the session id appears in URL?

         

iProgram

3:45 am on Nov 17, 2004 (gmt 0)

10+ Year Member



For example, in some php file I will read a session like the following:

<?php
session_start();
if($_SESSION['username'])
{
echo $username;
}
<html>
<head>..</head>
<body>
....
?>

My question is, will the above code affect the URL of this PHP file? I saw some website which uses session will affect the URL and I want to avoide this.

mincklerstraat

7:41 am on Nov 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



at the beginning of the page before
session_start()
, do
ini_set('session.use_only_cookies', 1);

if you want to avoid stuff appended to your url's. See [be2.php.net...] for more info.