Jump to content

Archived

This topic is now archived and is closed to further replies.

shoaibi

SESSIONS Problem!

Recommended Posts

You need to use post with or with out sessions to get the session to do somthink ha.

test.php
<?session_start();

$name=."my name is redarrow";
$age=."MY age is 31";

$name$_POST['name']
$age=$_POST['age'];

$_SESSION['name']=$name;
$_SESSION['age']=$age;

echo"<a href='test_rsult.php'>test me</a>";

?>

test_result
<?session_start();

echo "<br>$name:$age<br>";

?>

Share this post


Link to post
Share on other sites

nope that's not the case, i am not dumb enough to leakout my actual code like this even if just a inch of it ;), just wanna be more secure

Share this post


Link to post
Share on other sites
Ok idk what to do, here is the session code I ussually use:
[code=php:0]class session
{
function start($auth = true)
{
session_start();

if(!isset($_SESSION['user_id']) && $auth)
{
header('Location: login.php');
exit;
}
$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];
define('LOGGED_IN', (isset($_SESSION['logged_in'])) ?  $_SESSION['logged_in'] : false);
}
function destroy()
{
$_SESSION = array();
session_destroy();
}
}[/code]

Try that and see if it works.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.