Hi,
I am new to php. i need your help to pass the session value from php to jsp or java
I have an login and logout page in php. I have to pass the session value from login to welcome page of jsp
Thanks in advance
Reena
<?php
session_start();
/* For example, we have a session with three important data field: user, password und nickname.
$user = $_SESSION['user'];
$password = $_SESSION['password'];
$nickname = $_SESSION['nickname'];
/* Now we redirect to JSP Script and supply variables via URL: */
header("Location: http://www.domain.com/script.jsp?user=$user&password=$password&nickname=$nickname");
exit();
?>
I have an login and logout page in php. I have to pass the session value from login to welcome page of jsp
<?php
session_name('jsp');
session_start();
//... login stuff ...
$_SESSION['user'] = 'test'; // sanitized($_POST['user']);
//process auth($_POST['pw']) here already?
$_SESSION['authenticated'] = 1;
//... end login stuff ...
session_write_close(); //write to disk
header('Location: login_followup.jsp?SID=' . session_id());
// or header('Location: login_followup.jsp');
// and pickup the session_id from the 'jsp' cookie later
?>
user|s:4:"test";authenticated|i:1;
Users browsing this forum: No registered users and 36 guests