Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-16-2013, 09:23 AM   PM User | #1
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,177
Thanks: 214
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
regenerate sess id

Just curious if i have this process correct to avoid session id fixation

in my login file once the auth is done and everything is fine.

then i set the session values and also set this

PHP Code:
$_SESSION['oldid'] = 1
then it redirects and opens up the home page

and at the very top of that home page i have this so that it only executes this one time per login.

PHP Code:

//only do this one time per login
if(isset($_SESSION['oldid']))
{
echo 
"hellow old is set";
session_regenerate_id(true);
$_SESSION['oldid'] = '';


session_start(); 
Does that look about right?

Last edited by durangod; 02-16-2013 at 09:32 AM.. Reason: moved session start
durangod is offline   Reply With Quote
Old 02-16-2013, 05:06 PM   PM User | #2
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,177
Thanks: 214
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
Just an update, i did give up on this idea. No matter what i did or where i tried to do this i got some kind of warning or notice. I thought using this would be a good idea but i guess maybe one day i will learn where to use it..
durangod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:18 AM.


Advertisement
Log in to turn off these ads.