Making session_id same

<?php session_set_cookie_params(100, '/', ' .dot.kr'); session_start(); $sessionid = session_id(); echo "Session: $sessionid<br />"; echo '<hr><a href="http://dot.kr/joon/503log/02/02.php">dot.kr</a><br> <a href="http://subDomain.dot.kr/joon/503log/02/02.php">subDomain.dot.kr</a><br>'; ?>The above is all code at http://dot.kr/joon/503log/02/02.php .
if you click “dot.kr” several times, it produces a same session_id() and the value is always same as previous value for 100 seconds.

if you click “subDomain.dot.kr” several times, it produces a same session_id() and the value is also same as previous value for 100 seconds.
.
if you click “dot.kr” and “subDomain.dot.kr” in turns, Sometimes(mostly in chrome, fireFox, and opera, but safari has many problems) the value of “dot.kr” is same as the value of “subDomain.dot.kr”.

However, if you click “dot.kr” and “subDomain.dot.kr” in turns, you can notice, other times, the value of “dot.kr” is different from the value of “subDomain.dot.kr”.

when I open the page for the first time after I reboot my computers, it produces same values, but sometimes it produces different values between “dot.kr” and “subDomain.dot.kr”.

when the value of “dot.kr” is different from the value of “subDomain.dot.kr”, Is there anyway to make the value of “dot.kr” same as the value of “subDomain.dot.kr”?
(I’ve tried session_regenerate_id(); but I failed in making the both links has the same values.)

or, Is there anyway to put/change it the session_id() of my own value?

The code below is not work correctly, but it shows what I want.

change ($session_id(), '78568ba95f94f0a6c38161c05a908c2e');

I think you need to save your session data by session_set_cookie_params(100, ‘/’, ’ .dot.kr’); .dot.kr and subDomain.dot.kr at two different different location.

If still get issue cna you provide the code that you had written in http://dot.kr/joon/503log/02/02.php and http://subDomain.dot.kr/joon/503log/02/02.php

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.