Forum Moderators: coopster

Message Too Old, No Replies

when to create a session after login

         

mgworek

6:39 pm on Mar 31, 2006 (gmt 0)

10+ Year Member



I have created a signup page and login page that work.

Right now, if your user name and password match, it just says you have logged in, if they don't, it puts you back at login screen.

I have not messed with sessions before.

Do I create the session after the query and verifys the login? And then have it load my menu page, where i would call session?

jatar_k

7:23 pm on Mar 31, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you would create the session (store actual data) once the user is authenticated. You could look at this library [webmasterworld.com] thread for some examples

PHP User Authentication [webmasterworld.com]

mgworek

8:10 pm on Mar 31, 2006 (gmt 0)

10+ Year Member



ok, I have it working by if the user is valid, it logs in, creates a few $_sessions and then i include a menu page.

The session carries over fine.

It was not working before I used the include. I was redirecting the user to the menu page with header ( "location:.............

I put session_start(); at the top of the page but it wasn't working.

Should it have worked but I was doing something wrong?

Thank you.

mgworek

8:26 pm on Mar 31, 2006 (gmt 0)

10+ Year Member



its working for me via just a link so I guess it doesnt matter. Seems to be doing what I want.

Thanx