Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



PHP login session problem

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-09-2009
Member
 
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.

Reply With Quote
  #2  
Old 24-09-2009
Member
 
Join Date: Apr 2008
Posts: 1,946
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.
Reply With Quote
  #3  
Old 24-09-2009
Member
 
Join Date: May 2008
Posts: 2,004
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.
Reply With Quote
  #4  
Old 24-09-2009
Member
 
Join Date: Apr 2008
Posts: 1,997
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "PHP login session problem"
Thread Thread Starter Forum Replies Last Post
Multiple users with same login without session mix up joshpaddy Software Development 1 05-10-2011 06:09 PM
Rift Error: Your Login Session Has Expired Life spring Video Games 5 08-05-2011 07:31 PM
FTP problem - unable to make the session state request to the session state server. Benito Software Development 3 31-07-2009 01:09 PM
Firefox Login Session errors WarHammer Technology & Internet 1 03-11-2008 07:11 PM
Can't login locally after Remote Desktop session vshori Windows XP Support 3 07-03-2008 02:58 PM


All times are GMT +5.5. The time now is 04:42 PM.