Jump to content
xisto Community
Sign in to follow this  
electron

Sessions And Login Without Cookies

Recommended Posts

Hi,I have a login script i made using PHP sessions and MySQL.It works fine but there is a problem.As you know Sessions are stored in Cookies by PHP.So if someone has switched Cookies off then no sessions will work.How to solve this problem ?Please help me.Thanks and have a good day.

Share this post


Link to post
Share on other sites

Although for search engine purposes I wouldn't recommend it, it is possible to have PHP append the session ID to all links (eg. a link to '/page.php' becomes '/page.php?PHPSESSID=x'), as you've probably seen before. This eliminates the use of cookies.

Share this post


Link to post
Share on other sites

And another reason to NOT use this method is to avoid someone "highjacking" the session.A malicious user (read: Idiot with nothing better to do), if they somehow acquire the sessionid, could pretend to be the user and do some damage to your site. At least maybe for the user id involved.

Share this post


Link to post
Share on other sites

And another reason to NOT use this method is to avoid someone "highjacking" the session.A malicious user (read: Idiot with nothing better to do), if they somehow acquire the sessionid, could pretend to be the user and do some damage to your site. At least maybe for the user id involved.

Although not impossible, it is very difficult to guess a session ID by simply typing it into the URL. Additionally, sessions should always be re-enforced with IP checking, so if the IP 'x.x.x.x' establishes the session, an access attempt from 'y.y.y.y' with that session ID should result in the session being cleared and reauthentication required. As sessions usually only last for as long the browser window is open, the likelihood of a user changing IP addresses whilst using that session is slim.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.