0 like 0 dislike
499 views

I am Working on a Project, I need some clarification to share data between two sites in a high secure manner. Currently I am using Form Post to share data. But I think about if there is an option to get site-1 session-data from site-2, because I think using a session is more secure. I don't know how to use a sessions between two sites, but I hope someone here will know.

Like this:
Site 1 Coding

$_SESSION['cust_id'] = 'abc';  
$_SESSION['amount'] = '999';  

<a href=https://site2.com/direct.php?session_id=<?=$_SESSION['session_id']?>>Click Here</a>  

Site 2 Code in direct.php

$session_id = $_REQUEST['session_id'];  
$shared_data = XYZ_function($session_id);  

$cust_id = $shared_data['cust_id'];  
$amount = $shared_data['amount'];  

or is there any way to do the secure data sharing between two website other than form post, please tell me.


Thank you
Yours,
Karan

 

in Education & Reference by | 499 views

1 Answer

0 like 0 dislike
Best answer
It seems you're pretty heavy on security. If you need to share data from site 1 to site 2, you should do it through a single consumption bridge:

1). Click on a link on Site 1 to a handler file, let's call it redir.php.

2). Redir.php first checks the existing session data.

3). Redir.php writes relevant info into a DB row, along with some sort of identifier (say, an MD5 hash of the user ID + '_'+ current time), plus a 'consumed' flag, set false.

4). Redir.php does a 301 redirect to Site 2, along with the identifier.

5). Site 2 reads the relevant row out of the DB.

6). If the data is good and has not yet been 'consumed', return a success and mark the data as consumed.

7). If the data has been consumed, throw some sort of error.

There are more complex ways of doing this, but I think this handles what you're trying to do.
by

Related questions

0 like 0 dislike
1 answer
asked Apr 18, 2014 in Education & Reference by Yogi (180 points) | 61 views
0 like 0 dislike
1 answer
asked Apr 25, 2014 in Education & Reference by Neha (620 points) | 882 views
0 like 0 dislike
1 answer
0 like 0 dislike
0 answers
asked Jan 3, 2014 in Computers & Internet by Sahil (80 points) | 477 views
0 like 0 dislike
2 answers
asked Jun 26, 2019 in Education & Reference by Simmi (520 points) | 53 views
0 like 0 dislike
1 answer
asked May 29, 2019 in Education & Reference by Marc (2.4k points) | 67 views
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked Dec 13, 2018 in Education & Reference by Marc (2.4k points) | 68 views

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,202 questions
1,348 answers
553 comments
1,994 users