CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Protecting Sessions [PHP]

Print topic Send  topic

Author Message
feha


Posts: 712
Posted: 07/10/2006, 1:20 PM

  
//The function below will set current session's md5 Hash+IP.  
  
function VISION_TO_PROTECT_SESSION ()  
{  
if(!defined('SESSION_HASH')){define('SESSION_HASH',"PgJOfeCaUm90dGjY5qLXhtrHvQT3yW8nD");}  
  
if (!CCGetSession('PROTECT_SESS')) {  
$Protect_Session = md5(session_id() . "" . $_SERVER['REMOTE_ADDR'] . "" . SESSION_HASH);  
CCSetSession('PROTECT_SESS' , $Protect_Session);  
}   
}   
  
//The function below will check if current session is "original".  
function VISION_TO_CHECK_SESSION ()  
{  
if(!defined('SESSION_HASH')){define('SESSION_HASH',"PgJOfeCaUm90dGjY5qLXhtrHvQT3yW8nD");}  
$Protect_Session = md5(session_id() . "" . $_SERVER['REMOTE_ADDR'] . "" . SESSION_HASH);  
if (CCGetSession('PROTECT_SESS' ) == $Protect_Session) {  
return true;  
} else {  
return false;  
}   
}  
  
//Usage:  
VISION_TO_PROTECT_SESSION ();  
if(VISION_TO_CHECK_SESSION ()==false)  
{  
echo "No Hacking!";exit;  
}  


Include these functions att the bottom of your Common.php
more:
http://www.vision.to/CMS/Home/index.php?pid=62
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
Claudio Morinico
Posted: 07/12/2006, 1:51 PM

Hello feha,

Thanks for your tips, i hope to see more of them. I know you must have
collected tons of them while programming your CMS.

Best regards,

--
Claudio Morinico,
Montevideo - Uruguay.

El dia Mon, 10 Jul 2006 13:20:00 -0700, feha (feha@forum.codecharge)
dijo...
>
  
> //The function below will sett current session's md5 Hash+IP.  
>   
> function VISION_TO_PROTECT_SESSION ()  
> {  
> if(!defined('SESSION_HASH')){define('SESSION_HASH',"PgJOfeCaUm90dGjY5qLXhtrHvQT3yW8nD");}  
>   
> if (!CCGetSession('PROTECT_SESS')) {  
> $Protect_Session = md5(session_id() . "" . $_SERVER['REMOTE_ADDR'] . "" .  
> SESSION_HASH);  
> CCSetSession('PROTECT_SESS' , $Protect_Session);  
> }   
> }   
>   
> //The function below will check if current session is "original".  
> function VISION_TO_CHECK_SESSION ()  
> {  
> if(!defined('SESSION_HASH')){define('SESSION_HASH',"PgJOfeCaUm90dGjY5qLXhtrHvQT3yW8nD");}  
> $Protect_Session = md5(session_id() . "" . $_SERVER['REMOTE_ADDR'] . "" .  
> SESSION_HASH);  
> if (CCGetSession('PROTECT_SESS' . SUFFIX) == $Protect_Session) {  
> return true;  
> } else {  
> return false;  
> }   
> }  
>   
> //Usage:  
> VISION_TO_PROTECT_SESSION ();  
> if(VISION_TO_CHECK_SESSION ()==false)  
> {  
> echo "No Hacking!";exit;  
> }  
> 
>
>
> Include these functions att the bottom of your Common.php
> more:
> http://www.vision.to/CMS/Home/index.php?pid=62
> _________________
> Regards
> feha
> Vision.To Design
> www.vision.to
> wowdev.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
>
feha


Posts: 712
Posted: 07/19/2006, 2:40 PM

Hi Claudio
I'm happy for your feedback, please comment it here:
http://www.vision.to/CMS/Home/Comments.php?pid=62

I don't get much of feedback so i'm not sure if people enjoy my tips.

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
wkempees


Posts: 1679
Posted: 07/19/2006, 3:36 PM

Of course we do.
(Fishing?)
Walter

_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)

if you liked this info PAYPAL me: http://donate.consultair.eu
View profile  Send private message
Damian Hupfeld
Posted: 07/20/2006, 6:24 AM

Slowly but surely we are building a clone Vision CMS application with all
your recently revealed tidbits.


"wkempees" <wkempees@forum.codecharge> wrote in message
news:2544beb3fca8f36@news.codecharge.com...
> Of course we do.
> (Fishing?)
> Walter
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

feha


Posts: 712
Posted: 08/13/2006, 2:56 PM

Quote Damian Hupfeld:
Slowly but surely we are building a clone Vision CMS application with all
your recently revealed tidbits.

Great :-)
I enjoy when others like my work :-)

_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.