Results 1 to 4 of 4

Thread: PHP login session problem

  1. #1
    Join Date
    Jul 2009
    Posts
    67

    PHP login session problem

    I have a login script that uses session variables across the site to make sure a user is logged in on every page. However some of my users report a problem of not being able to login. So, can any body tell me that how can i create PHP login with session variables? Does any body knows about it? Pleas provide me the correct way for doing it.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: PHP login session problem

    You need first to decide what information to store about members, the examples provided will assume almost nothing to make it easier to read. Then you need to create a text file called config.php and add in the following code into that textpage. Session are useful when we want to keep track of users as they roam through a site. Using session, we can make sure that only those who have a valid username and password can gain access to a specific part of a site, or in the case of any online store; keep track of what is in the shopping chart at any given time.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: PHP login session problem

    Session support in PHP consists of a way to preserve certain data across subsequent accesses. Save that file as config.php Next, create another test file as index.php and copy the following text into that file. This enables you to build more customized applications and increase the appeal of your web site. It is important to note before you start that the code relies on classes and the key variables of this Login System are class objects.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: PHP login session problem

    Username and password should not be constants of course, remember is a boolean flag which if set will send a cookie to the visitor to allow later automatic logins. A session can not be written to after there has been any form of output on screen. This means that all session-related code should be above all HTML-code, or any code that'll produce any output. Any error messages from any other script before the session is set, will result in the session not being set.

Similar Threads

  1. Multiple users with same login without session mix up
    By joshpaddy in forum Software Development
    Replies: 1
    Last Post: 05-10-2011, 06:09 PM
  2. Rift Error: Your Login Session Has Expired
    By Life spring in forum Video Games
    Replies: 5
    Last Post: 08-05-2011, 07:31 PM
  3. Replies: 3
    Last Post: 31-07-2009, 01:09 PM
  4. Firefox Login Session errors
    By WarHammer in forum Technology & Internet
    Replies: 1
    Last Post: 03-11-2008, 08:11 PM
  5. Can't login locally after Remote Desktop session
    By vshori in forum Windows XP Support
    Replies: 3
    Last Post: 07-03-2008, 03:58 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,695,030.93836 seconds with 17 queries