Jump to content

PHP sessions without cookie, ID in index.php URL ?


Recommended Posts

session.use_cookies Off

session.use_trans_sid On

When i go to index.php, sesionID does not appear in the URL and when i press "refresh" - starts a new session :rolleyes: Going on link, solves the problem. But how to add sessionID in first page URL ?

P.S. sorry for my english :)

Link to comment
Share on other sites

  • 3 weeks later...

instead of just putting

session_start();

put this code:

if (isset($_GET['s']))
   session_id($_GET['s']);
session_start();

then on everylink on your site put:

<a href=\"myurl.php?s=".session_id()."\">My link</a>

either that or you can make a javascript that adds the session id onto any link, im not sure how you would do this.. :(

the only other thing, is instead of echo ing the page content, save it to a variable.

Then go:

$mySite = "site content";
$mySite = str_replace( ".php", ".php?s=".session_id(), $mySite);

good luck :D

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...