Hiding Session Id

Started on the old forum in January 2009 · view the original in the archive · old links redirect here

134 replies · 11,752 views · started 17 years ago · 1 min read

TL;DR · summary of 134 replies
  • -mod_rewrite would not be effective for hiding session IDs as they still need to pass through URLs.
  • -Using dynamic variables like IP or browser information could help prevent session hijacking, but it may not be foolproof.
  • -Adding username and password to the authentication process can strengthen session security by defining both the user and their credentials.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

38 participants
anderson Developer · 146 posts #81

ori wrote: was that in login cos i did a lava edit and had 2 put $_SESSION['sid']=md5($did);

Yes ori. I face that problem from login.php. I am using lavalair wml version.

Wait...

anderson Developer · 146 posts #82

I am 50% successful. It is working except WAP 1.0 browser. This kind of browsers cant collect session. So when users with this browsers try to enter homepage it shows "session expired", at the same time if anyone uses WAP 2.0 browser he can enter homepage successfully.

Whats the solution for it?

Wait...

kiLLeR-eyEd_14 Senior · 382 posts #83

Hide Session ID in lava/wapd

This is what i've done successfully.. In core.php put this

session_start(); $sid = $_SESSION['sid'];

on top or bottom then in login.php find

$sid = md5($did);

and change it to

$_SESSION['sid'] = md5($did); $sid = $_SESSION['sid'];

observe it..After defining $_SESSION['sid'] as an md5($did) then define $sid as $_SESSION['sid'] so that it means $sid = $_SESSION['sid'] while the value of $_SESSION['sid'] = md5($sid); then on every page, you don't need to put something 'cause the session_start() and $sid = $_SESSION['sid'] is already in core.php and core.php is already included on every page..You just need to remove all $sid = $_GET['sid'] and all &sid=$sid..To display if not logged in or session expired i made this code

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx")) { $uid = getuid_sid($sid); if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid']))) { put here your codes for ses expire }
}

then to destroy session, put this on top or bottom of the msg successfully logged out,

unset($_SESSION['sid']); $_SESSION = array(); session_destroy();

kabooms Developer · 80 posts #84

i allready try this code and i work good ahehhehe

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx"))
{
$uid = getuid_sid($sid);
if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'])))
{
put here your codes for ses expire
}
}

ok mate thnaks for this code i try to edit session expire if low phones can handle this if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'] ahehehe -up- thanks!!!!

kiLLeR-eyEd_14 Senior · 382 posts #85

kabooms wrote: i allready try this code and i work good ahehhehe

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx"))
{
$uid = getuid_sid($sid);
if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'])))
{
put here your codes for ses expire
}
}

ok mate thnaks for this code i try to edit session expire if low phones can handle this if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'] ahehehe -up- thanks!!!!

you may also try to add the old one, like this..

if((empty($_SESSION['sid'])||(!isset($_SESSION['sid']))||(islogged($sid)=="false")||($uid=="0"))

ok?..That's how pinoy rockz!!!Hehehe..I'm working for a new script and i'm going to remove ses id from url..Also put wml and html codes in 1 file..Auto-detect if supports html then header and footer returns html codes..Else, return wml codes..So that i wudn't be tired of doing separate codes and directories for wap and web

kazzin Junior · 33 posts #86

where add this code

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx"))
{
$uid = getuid_sid($sid);
if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'])))
{
put here your codes for ses expire
}
}
kabooms Developer · 80 posts #87

kiLLeR-eyEd_14 wrote: if((empty($_SESSION['sid'])||(!isset($_SESSION['sid']))||(islogged($sid)=="false")||($uid=="0"))

thankz mate wow nice idea. Will you share it us? Hmm i think it like funmobile script wml and xhtml in 1 file.. Bro killer eyed can i ask for a code about registration, password send via email can u help me ?Pls pm me..Thankz..

kiLLeR-eyEd_14 Senior · 382 posts #88

kabooms wrote: thankz mate wow nice idea. Will you share it us? Hmm i think it like funmobile script wml and xhtml in 1 file.. Bro killer eyed can i ask for a code about registration, password send via email can u help me ?Pls pm me..Thankz..

that's very easy, but b4 u make it, ur webhost must support the php mail() function..I've done coding it in my site a month ago..

robzky Developer · 205 posts #89

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx")) { $uid = getuid_sid($sid); if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid']))) { put here your codes for ses expire } }

Where Can I add this script?

LESS TALK. LESS MISTAKE.

HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

kabooms Developer · 80 posts #91

kiLLeR-eyEd_14 wrote: that's very easy, but b4 u make it, ur webhost must support the php mail() function..I've done coding it in my site a month ago..

yah bro killer eyed i will buy a 1year webhosting this coming 23 or 24 of july here at makati medyo mahal pero cguro okey naman bka may ma offer ka n mura n webhost jan al0ng manila kita tau i paid u cash or bank? Ok lng bro na pa copy naman ng register password send by email need q kc para iwas pasaway na wapper.. The code work like an angel i try in my wamp server .Thankz...

robzky Developer · 205 posts #92

kiLLeR-eyEd_14 wrote: on every page or file.,to know if session really starts and set.,else return ses expire..

-Ive Got it.. thanks Killer-eyed..

LESS TALK. LESS MISTAKE.

HTTP://APPSROB.COM - LIST OF MY FACEBOOK APPS!

kiLLeR-eyEd_14 Senior · 382 posts #93

kabooms wrote: yah bro killer eyed i will buy a 1year webhosting this coming 23 or 24 of july here at makati medyo mahal pero cguro okey naman bka may ma offer ka n mura n webhost jan al0ng manila kita tau i paid u cash or bank? Ok lng bro na pa copy naman ng register password send by email need q kc para iwas pasaway na wapper.. The code work like an angel i try in my wamp server .Thankz...

pgka2alam q mer0n na t0pic nyan dto.,search mu na lng..

kazzin Junior · 33 posts #94

kiLLeR-eyEd_14 wrote: This is what i've done successfully.. In core.php put this

session_start(); $sid = $_SESSION['sid'];

on top or bottom then in login.php find

$sid = md5($did);

and change it to

$_SESSION['sid'] = md5($did); $sid = $_SESSION['sid'];

observe it..After defining $_SESSION['sid'] as an md5($did) then define $sid as $_SESSION['sid'] so that it means $sid = $_SESSION['sid'] while the value of $_SESSION['sid'] = md5($sid); then on every page, you don't need to put something 'cause the session_start() and $sid = $_SESSION['sid'] is already in core.php and core.php is already included on every page..You just need to remove all $sid = $_GET['sid'] and all &sid=$sid..To display if not logged in or session expired i made this code

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx")) { $uid = getuid_sid($sid); if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid']))) { put here your codes for ses expire }
}

then to destroy session, put this on top or bottom of the msg successfully logged out,

unset($_SESSION['sid']); $_SESSION = array(); session_destroy();

plz help me to add this code in action=logout

unset($_SESSION['sid']);
$_SESSION = array();
session_destroy();

one problm is there m successfully login bt i cant c owner cp also delete option of shout in main page y ownercp option is hide plz fix dis prblm

kazzin Junior · 33 posts #95

guest can enter the site if ryt url hummingbird feeder tube urs classic at ursite.com there is nothing show ur session id expire also this code show error parse error { sign creating prblm

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx"))
{
$uid = getuid_sid($sid);
if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'])))
{
put here your codes for ses expire
} 
}
kiLLeR-eyEd_14 Senior · 382 posts #96

kazzin wrote: plz help me to add this code in action=logout

unset($_SESSION['sid']);
$_SESSION = array();
session_destroy();

one problm is there m successfully login bt i cant c owner cp also delete option of shout in main page y ownercp option is hide plz fix dis prblm

try using the function isowner($uid) c0z that's also my pr0b and i s0lved it by using that

shad0w Developer · 119 posts #97

Why do you need to make session protection for lavalair ?? You can make

$browser[0] = select browser from ..._users;
$nowbrowser = getbrowser();
if ($browser[0]!==$nowbrowser)
{
LOGOUT USER
}

The same thing can be made for IP too ..

whatmp3.name - search mp3 on mobile

i0nutzxp Developer · 150 posts #98

shad0w wrote: Why do you need to make session protection for lavalair ?? You can make

$browser[0] = select browser from ..._users;
$nowbrowser = getbrowser();
if ($browser[0]!==$nowbrowser)
{
LOGOUT USER
}

The same thing can be made for IP too ..

its a not god idea 😊

<?php unlink('World/Europe/Romania.country'); ?>
kiLLeR-eyEd_14 Senior · 382 posts #99

kazzin wrote: guest can enter the site if ryt url hummingbird feeder tube urs classic at ursite.com there is nothing show ur session id expire also this code show error parse error { sign creating prblm

if(($action != "") && ($action!="terms") && ($action!="gviewfrm") && ($action!="gviewcat") && ($action!="gviewtpc") && ($action!="gforumindx"))
{
$uid = getuid_sid($sid);
if((empty($_SESSION['sid']) OR (!isset($_SESSION['sid'])))
{
put here your codes for ses expire
} 
}

add islogged($sid)==false OR $uid==0 then ses expire

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close