Jump to content

Help And Input Needed: Coding a very complete user authenication code


Recommended Posts

hi! I'm coding a user authentication script for a site and it needs to have the following features:

1) after logging in return to the previous page the user was in

2) if cookies are disable pass session id thru url

 

and since the site is an ezine alot of variables will be passed thru the url. for example the category.php page will have a url like this:

category.php?setCat=1&sortby=date&numresultperpage=5

 

my current plan is this:

each page will start with session_start();

once the user log ins from any page it will post the data to

authentication.php?returntopage=whicheverpage.php

in authentication.php page all the data will be verified and if the user is found in database it will make username a session variable and goto session.php?htmlspecialchar(SID)

 

in session.php page it will start session and check if session cookie is found.

if session cookie not found then
  $_session['append0']="?".htmlspecialchars(SID)."&"   //to be used if more variables will be passed with the url
  eg: echo "category.php".$_session['append0']."setCat=1&sortBy=date;
  $_session['append1']="?".htmlspecialchars(SID) // to be used if no variables will follow

if session cookie found then
  $_session['append0']="?"
  $_session['append1']="?"

the $_session['append0']/$_session['append1'] will be added to every url in the site

 

any ideas?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.