Click to See Complete Forum and Search --> : session help?


ba02000
03-08-2006, 01:36 AM
Hi guys,

I want to know how can I take user when session lifetime is over to login page so if he want to continue surfing my site he needs to login again.

Regards,

Khalid Ali
03-08-2006, 07:22 AM
question is ambiguous...pls explain more....if a session is expired and u want user to login again without session, u can create a new session whenever user tries to access any pages, however if thats the case then what realy is the purpose to set session security?

ba02000
03-08-2006, 08:37 AM
thank you man,
I mean When session lifetime is over by exceeding its life time, the user will be redirected to the login page if he want to continue surfing my site.

hope that explain what I want to do.
if you could provide your answer with an example, that will be better.

Thanx.

Khalid Ali
03-08-2006, 08:53 AM
well that is the normal session implementation. This is how u do it.
User logs in
From this point every page user visits, youcheck for a valid session.
If the session is there you allow user to surf, if it is expired you redirect user to login page again.
make any sense?

ba02000
03-08-2006, 01:21 PM
thanx man,

one more thing please, I want to build login page that forwared users according to their privilege, for ex. when a user with (User) privilege enters his username and password correctly he will be forwarded to the general page, when user with Mod privielege enters his username and password correctly he will be forwarded to the moderator page, and when user with Admin privilege enters his username and password correctly he will be forwarded to the Administrator page.

Thanx again for your helps.

Khalid Ali
03-08-2006, 03:15 PM
well for this you will have to create some persistence logic in db which will have info on how a user with certain rights can access to certain resources on site.
e.g when a user logs in, you check their user name, then check which rights they have and then for those rights( a certain group) you will create a cpecifc page or may be direct to already created page for that group....hope it made any sense to you..:-)