Sessions And Login - Without Cookies

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Sessions And Login - Without Cookies

electron
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.

Reply

Spectre
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.

Reply

jlhaslip
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.

Reply

electron
I know so how to Log In a User if Cookies are Disabled.

Please tell me.

Reply

Spectre
QUOTE(jlhaslip @ Jun 29 2006, 11:06 AM) *

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.

 

 

 


Reply

electron
So anyone can help me with this.
Please help me.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. use session in php without login - 37.24 hr back. (1)
  2. how to make login page in php wiyhout session - 53.92 hr back. (1)
  3. login without cookies in php - 109.04 hr back. (1)
  4. track user login session php - 137.15 hr back. (1)
  5. how to make a login -logout page using session - 150.27 hr back. (1)
  6. php intranet session login - 161.73 hr back. (1)
  7. .htacess "login cookies" - 274.74 hr back. (1)
  8. php login without session - 381.18 hr back. (2)
  9. php login without sessions - 115.35 hr back. (2)
  10. ipb session login script - 431.28 hr back. (1)
  11. without login create session php - 487.39 hr back. (1)
  12. user login cookie, session, database system - 531.78 hr back. (1)
  13. logins without cookies - 556.44 hr back. (1)
  14. login system without session - 578.82 hr back. (1)
Similar Topics

Keywords : sessions login cookies

  1. Something I Discovered With Sessions [php] - (4)
    Hello All, I've been doing a lot of PHP programming since I last posted here. I've run
    across two security related things with sessions that you may or may not know about. The first one
    pertains to the session id, or the id that PHP assigns each computer when a session is created.
    This id is either stored in a cookie (search for PHPSESSID) or through the URL as GET data.
    Remember that all session data is stored server side; this ID is the only thing that PHP will use to
    differentiate your computer from someone else's. While I was programming for Plug ...
  2. One Login Account At One Time - (3)
  3. Php Sessions And Post Variables Issues - My script dosent seem to work as intended (1)
    You can test it out for yourself at http://sonesay.trap17.com/application.php I've been
    working on this page locally and it seems to be working fine but when I upload it to my trap17
    account the post variables dont get saved properly. Fill in some fields and submit it, the form
    will come up as a empty field yet when you resubmit it without any modifications and the data you
    entered in orginally will now magically appear, resubmit it again and it will be gone. This is
    really annoying as I have no clue why it would be doing this when it seems to work fine locally....
  4. Is This A Good Script? - A login script (9)
    Okay, I am trying to password one page of my website. I need confirmation if this is a safe code or
    not. The whole code is on the page I'm protecting. CODE <?php
    include('header.php') ?> <?php // Define your username and password
    $username = "THE_USERNAME"; $password = "THE_PASSWORD"; if
    ($_POST['txtUsername'] != $username ||
    $_POST['txtPassword'] != $password) { ?>
    <h1>Login</h1> <form name="form" method=&...
  5. Automatic Login Using Curl - (1)
    If you'are lazy people like me. This script may help u. This script is to automated our login to
    some site. You must have cURL installed to use this script. CODE <?php // INIT CURL
    $ch = curl_init(); // SET URL FOR THE POST FORM LOGIN curl_setopt($ch,
    CURLOPT_URL, 'http://www.external-site.com/Members/Login.php'); // ENABLE HTTP POST
    curl_setopt ($ch, CURLOPT_POST, 1); // SET POST PARAMETERS : FORM VALUES FOR EACH
    FIELD curl_setopt ($ch, CURLOPT_POSTFIELDS, 'fieldname1=fieldvalue1&fieldna...
  6. Blank Cookies... - Need some help with Cookies... (4)
    Hi. I'm doing a website that basically checks if it has chosen a css style before. If it has, it
    shows the last shown style, and if it doesn't, it shows "natura" style. On the page there's
    a form that lets the user choose the style. It is based on cookies. The thing is that when I do java
    script:alert(document.cookie) on the address bar it gives me a blank alert! And, obviously, when
    I reload the page, the style doesn't change!!! The thing is I'm sure it has
    nothing to do with the HTML code, and I also thing it does have nothing to do ...
  7. Html Site With Login - Is it possible? (2)
    Hello. I´m building my own site and I need some help... Is it possible to use a login sistem in php
    and mysql database in a html site? ...
  8. Login System - (6)
    i am designing a site for my alliance for the game Dark Throne. and i want some content to be
    availabe to members of the alliance only, and other content to be available to people with a certain
    rank within the alliance. i know this should be somewhat simple, but i am not that sure how to do
    it. my idea for the website is just have basic info about the alliance available to everyone, then
    news about the alliance and member lists and other things like that available to every alliance
    member, then things such as the strike team, diplomat team, and special areas like that,...
  9. Php Login Script - (1)
    I'm looking for a good php login script. I would like one where it pops up. like http-auth. but
    with out the data base. I would also like for it to have a log out fuction....
  10. Creating A Login Box That Links To My Phpbb Forum - Have my phpBB Forum Intergrated with my Website (4)
    Can someone please give me a code that I can use to put a login box on my website, that will login a
    user into my phpBB Forum? Sort of like Having my phpBB Forum Intergrated with my Website? Thank you
    so much if you can! /angel.gif" style="vertical-align:middle" emoid=":angel:" border="0"
    alt="angel.gif" /> Ex. ...
  11. Windows Login Credentials - (0)
    On an intranet I'm running php. apache and mysql. We use Windows logins. I have a form that
    users can submit. This will require a login. I would prefer to use the windows login and passwords.
    can I link to the windows authentication? The issue I see is when a user changes the password. My
    link would need to update the password...
  12. <?php ?> Sloppy Login Script - Sloppy login script, couse i used @ on one string (12)
    Here's a sloppy 3 files login script. First file is Login file that looks like this login.php
    CODE <form action="check.php" method="post"> Username: <input
    type="text" name="username1"><br /> Password: <input
    type="password" name="password1"><br /> <input type="submit"
    value="Login"> </form> Basicly that is HTML form that's used for input
    Second part of the script is the check.php that we call from our login.php form QUOTE ...
  13. <?php ?> Unique Visitors Script - Flat file unique visitors script (no sessions) (2)
    This is really simple script. Well at least this part is, but it could be extendable. Only problem
    is that it's not really for massive websites with hundread of visitors a day, but rather for
    small ones. But it is a good script to figure out how to make a visitor counter script. Anyway
    here's the snippet. CODE <?php function getVisits($variable) {
        $visits = array();     if ($handle =
    opendir('stats/')) {     while (false !== ($file =
    readdir($handle))) {  ...
  14. Phpmyadmin Login Problem! - (1)
    I have easyphp. But i can not log when i go to phpmyadmin. I directly enter the page. But i think i
    should normally have to log in before enter that page. What should i do to configure the access to
    phpmyadmin? Thank for help...
  15. Login System Help... - (3)
    I know, nol tried to use this script.. and erm.. i think failed.. but i installed it all good, works
    fine, UNTILL........ i tried to add a new option to the registration. Thhis is the url to the
    site.. where the dl is.. http://evolt.org/PHP-Login-System-with-Adm...nts_per_page=50 I would
    really appreciate it if somebody could add, in all the php files properly a new registration thing,
    called "name" where they write their name in so i know it for future reference. if somebody could
    get that to me i would really appreciate it. ALSO... if you can't do that, or jus...
  16. <?php ?> Get Search Results To Your Localhost - Simple way to get 100 results without allowing cookies (2)
    Ultimately simple script that allows you getting google search results to your localhost. This is
    the first part of the Crawler script i'm developing, and if you are interested in developing the
    script with me, IM me @icq328866661@msn/evil_matak/ a \hotmail-com. Here's the form
    part... QUOTE search.php QUOTE if (@$_POST ==""){ echo "What are you
    doing?"; } else{ $query =
    file_get_contents("http://www.google.com/search?q=".urlencode($_POST
    )."&num=100&hl=en&ie=UTF-8&filter=2"); //needs to be added with more queries �...
  17. New Arisen Site Problem - Nettek Login Trouble (2)
    Okay, so I installed Nettek and got everything set up. But every time I try and login, it says
    it's incorrect. I've gone into the Database and gotten the password and since it was
    simple, put them in and had tried but with no success. I tried changing the password but I still
    couldn't get in. I tried adding another login and it still didn't work. I have no idea
    what's wrong and I need some help....
  18. What Does This Do? - $ban = ($data->login) ? $lban : $iban; (4)
    I'm correcting a 'few' php-files for a friend, but I got this line of code: CODE
    $ban = ($data->login) ? $lban : $iban; and I don't know
    what it does xD Could someone please explain me what this line does? Thanks...
  19. Help Improving My Login Script Code - The code works okay...just not the authorization part (4)
    I have developed a piece of code /smile.gif" style="vertical-align:middle" emoid=":)" border="0"
    alt="smile.gif" /> that is going to work as my login script for my website. I need some help making
    improvements and creating additional features. Here is my code: CODE <?php
    session_start(); $name = $_POST['username']; $password =
    $_POST['password']; $con =
    mysql_connect("localhost","myDbUser","myDbPassword");
        if(!$con)         {         die(&#...
  20. .htaccess-style Login System And Php - (13)
    I am trying to make a login system that looks and works like .htaccess using sessions, with a PHP
    script that detects the username used. Let's say I log on with the username "Amezis" and
    correct password. Then I want a PHP (or any other kind of script) to create a cookie or session
    which stores the user name, so it could be possible to store it in a variable as long as the user is
    logged in, and so it can be printed when needed. Basically, this is what I want the script to do:
    CODE /* This file can only be executed after logging in with the htaccess-style login...
  21. Login Script - (11)
    I am using the following code as a login page. I try to start by checking if a session already
    exists so that people don't have to login each time. The problem is that it is just being
    ignored. How do I check if a session is already set? CODE if
    (isset($_SESSION['loginname'])) { print('you were
    already logged in'); } else { if (submit) {
      list($users,$passwords,$accounttypes)=GetCurrentUsers($user,$
    password,$accounttype);   $nologin=1;   for (&...
  22. Using Sessions Instead Of Cookies, Help Please - (1)
    This is a simple code to register and login.. this uses cookies.. i want to use sessions instead..
    can someone tell how i can do it ? config.php CODE <?    ob_start(); // allows you
    to use cookies    $conn =
    mysql_connect("localhost","USER","PASSWORD");   
    mysql_select_db(DATEBASE) or die(mysql_error());    //fill in the above
    lines where there are capital letters.    $logged = MYSQL_QUERY("SELECT * from users
    WHERE id='$_COOKIE[id]' AND password = '$...
  23. Session Variables - Sessions in PHP behaving strangely (4)
    Hi. I am part of a development team working in PHP and MySQL. The site is using SSL, and users
    have to log to use the site. When users log in, their important details are retrieved from the
    database and stored in session variables (functionality in the site is permissions specific).
    Lately, sessions are "disappearing" for no apparent reason. Users will log in, and at some point
    (the length of time will vary unpredicatably) the sessions will lose their value (the variables are
    empty) and this causes the site to evict the user. This is very frustrating for the user b...
  24. Login / Authetication System Using Database - adding information (4)
    Is there any way to make such database where I can write like name and passwords.. Then make an
    login box, and when somebody trys to acces the login he needs to write the name and password.. Then
    it is verifyed if is there such name and password and if it is then acces the page.. I think there
    is posible something like that with MySQL (db).. but can anybody say me a script or way to make
    something like that? Alredy thanks.....
  25. "grand" Login System? - To Forums, Chat, and Site (7)
    Major problem I got here. A site at which I am employed as PHP Coder (privet-drive.com), needs a
    "grand" login. The login needs to be able to login them into the forums, the chat, and the site, all
    at the SAME time! The big problem is, the chat is located on another website (potterchat.net),
    and the forums are IPB and not PHPBB. Any comments, or some tips on how I am to go about this? I am
    freaking out, and any advice at all would be nice! Thanks in advanced!...
  26. Customizing Login Script - please help anyone good in PHP.. (8)
    On my main site i have this login box: Click here! ... And I want to change the look of it in
    new adress but I have only things can be get from that adres.. I put that login box (new) in my
    website and changed the page that opens but when you try to login with wrong username or password..
    It opens like you typed right usernam and password.. So I need to make it work like normal login
    box but there can be logen in with only right username and password.. I think there need to be added
    some cookies or something to that page.. So someone who is good in PHP please help...
  27. Cookies - How to make something like that? (1)
    Can anybody help me? Im making new website and there will be needed such thing as login... so there
    will be needed thing as cookies too. Can anybody please tell me how to make them and how and where
    to use them? Alredy thanks, Dawiss...
  28. Problem With A Login Script - (10)
    I'm making a simple login script, but it doesn't seem to work like I want. The error
    messages work, but if I actually write the right username and password, it won't work.
    Here's the message I get: QUOTE Warning : Cannot modify header information - headers
    already sent by (output started at /home/ngnorge/public_html/fsm/index.php:7) in
    /home/ngnorge/public_html/fsm/logginn/login.php on line 9 Here's the script: login.php
    CODE <?php include('config.php'); if($action ==
    "submit"){ if((...
  29. Login - (4)
    I have a mysql database with 99 people. The first column on db is call id and assigns a diferent 4
    digit number to each person. Second column contains each person`s complete name.... someone tells
    me i need an adittional user column to asign a username to each person...(cause i want a login page)
    but since i already have a different name and a different id for everybody, why would i need a such
    column? can someone please tell me how can i use this 2 columns (name and id) so they can type
    their complete 4 digit id and just part of their name to enter through a login p...
  30. User Login System With Setcookies - (13)
    a friend of mine is quite good at php and told me not to use sessions and to use setcookie im not
    sure how to use setcookie to make a user authentication system and was wondering if anyone here know
    a tutorial on how to do it...



Looking for sessions, login, cookies

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for sessions, login, cookies

*MORE FROM TRAP17.COM*
advertisement



Sessions And Login - Without Cookies



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE