Warning: Invalid argument supplied for foreach() in /home/astahost/public_html/info.php on line 796
Php And Session
  Nov 21, 2009

Php And Session - Talk about Session Handling in PHP

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Php And Session - Talk about Session Handling in PHP

thedevil
I have a problem in handling Session. When I log on to my site using the passwords and username that i have maintained in my database... After authentication, I start a session... but still when i again visit the admin page it asks me the username and password... I have added all the authentication and checking...

Comment/Reply (w/o sign-up)

wanhafizi
Please make your code avaliable to others so that we can analyze it.

Comment/Reply (w/o sign-up)

Houdini
It sounds like it is a database problems and not a session problem, have you optimised your database, or looked at it and be sure that the authors table is correct?

Comment/Reply (w/o sign-up)

Hercco
How do you transfer the session id? Do you use cookies, have cookies as optional or rely completely on GET variable?

And do you save the session id into database and check it from there?


Oh and your code would be helpful too. Just explain it or have it properly commented.

Comment/Reply (w/o sign-up)

thedevil
QUOTE (Hercco @ Aug 1 2005, 09:39 PM)
How do you transfer the session id? Do you use cookies, have cookies as optional or rely completely on GET variable?

And do you save the session id into database and check it from there?
Oh and your code would be helpful too. Just explain it or have it properly commented.
*


actually I dont pass the session id in to pages but rely on get... moreover... i use code as such

CODE
session_start();
$_SESSION['<somevariable>']='someting';

and use this variable to see if the person has logged in or not... as
CODE
session_start();
$_SESSION['logged']=true;

in some other pages
CODE
if (isset($_SESSION['logged'])&&$_SESSION['logged'])
{
//Some codes
}
else
{
// other codes
}


Is this all right or am I just making it feel stupid...
please tell me better way to handle sessions and with code if any
Thank you

QUOTE (Hercco @ Aug 1 2005, 09:39 PM)
How do you transfer the session id? Do you use cookies, have cookies as optional or rely completely on GET variable?

And do you save the session id into database and check it from there?
Oh and your code would be helpful too. Just explain it or have it properly commented.
*

HeLp me know about session id and its uses how to pass session id into pages... i have seen PHP self passing id through PHPSESSID in GET variable... how will I save the Session id??? and use it later on...

 

 

 


Comment/Reply (w/o sign-up)


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*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Php Session Session Handling Php

  1. Need Help - How To Remove Session ID From URL - (6)
    Oflate I was going through Google information for webmasters and I noticed the following technical
    guideline for the webmasters: QUOTE Allow search bots to crawl your sites without session IDs or
    arguments that track their path through the site. These techniques are useful for tracking
    individual user behavior, but the access pattern of bots is entirely different. Using these
    techniques may result in incomplete indexing of your site, as bots may not be able to eliminate URLs
    that look different but actually point to the same page. It clearly shows that undesir...
  2. User Authentication Session Handling Problems - Authorization server variables not staying across pages (14)
    This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I
    have been lurking around here at the Asta Host forums with regard to login and user authentication
    scripts and I have got as far as this: - Starting a session - Registering a session variable -
    Using the variable to check if the user is authenticated or not. - Authenticating the user through
    MySQL database - Logging of the user, by setting the session variable to un-authenticated I have
    been able to achive the following things too that I think is not related to this proble...
  3. Php, Sql Lite: Storing Session's Data? - how so store session in SQLITE? (1)
    normally, in windows, session data is saved in the location as directed by the "session.save_path"
    directives. they only show how to store session data in file. is it possible to store it inside the
    SQLite? anyone?...
  4. Run A Script When Expires A Session - (6)
  5. Php Session Problem - (7)
    i have downloaded easyphp on my PC and i am a bit noob with php mysql commands. i have a problem
    making session work the problem that the session file in my server get deleted after leaving the
    page where the session was start for the first time. the problem that the session can only be used
    within the creation page unless you leave it. why?? i have no idea ... i have been looking around
    for three days now .. thank in advance for any help. if you need more details let me know
    /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />. Joe.k...
  6. Already Sent Session Cookies? - (2)
    Er, this is the second topic I've posted about session problems. Here's the html file that
    keeps showing up: CODE Warning: session_start() : Cannot send session cookie - headers already
    sent by (output started at C:\Program Files\xampp\htdocs\index2\loggingin.php:2) in C:\Program
    Files\xampp\htdocs\index2\loggingin.php on line 39 Warning: session_start() : Cannot send session
    cache limiter - headers already sent (output started at C:\Program
    Files\xampp\htdocs\index2\loggingin.php:2) in C:\Program Files\xampp\htdocs\index2\loggingin.php on
    line 39 Fatal ...
  7. How To Delete Files When Session Ends - (4)
    Dear Friends I need solution to a problem. The problem is as under: I am creating certain files
    (playlist) in server disk when user selects some songs. The files are created in ram format. What I
    want to do is to delete these files created during a particular session. Is it possible to do so?
    Now I am deleting these files using on Unload event fired by JavaScript. I am using PHP. ...
  8. Session And Security - (0)
    Hi everyone, I'd like to explain my idea for basic session handling to you guys. I've
    thought about it, and I can't see any problem with it, but I'd like other's opinions as
    well, please. Ok, here goes. So basically, there's two base cases that can happen. User
    visits any page, session class is initialized, etc. Case 1 - User not logged in; no cookie or
    session info in DB If the user is not logged in, has no cookie, and/or there is no session info in
    the DB for this user, any specified activities, protected like so: php: if ( $session...



Looking for php, session, talk, session, handling, php

See Also,

*SIMILAR VIDEOS*
Searching Video's for php, session, talk, session, handling, php
advertisement



Php And Session - Talk about Session Handling in PHP

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com