Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,450 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,063 people online right now. Registration is fast and FREE... Join Now!




a page opens without logging in if we directly type the address

 
Reply to this topicStart new topic

a page opens without logging in if we directly type the address, ASP.NET

jenni_praga2010
7 Aug, 2008 - 11:48 PM
Post #1

New D.I.C Head
*

Joined: 7 Aug, 2008
Posts: 1

Hi,
please anyone help me. I have a login form which validates username and password from data base . I included a code as below

server.transfer("afterlogin.asp")

after logging in it opens the afterloign.aspx page. correclty and it works fine.

the problem i have is, if i thpe the address of that page in the address bar it opens without logging in.

can anyone help me to stop this?




User is offlineProfile CardPM
+Quote Post

dineeshd
RE: A Page Opens Without Logging In If We Directly Type The Address
7 Aug, 2008 - 11:57 PM
Post #2

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 578



Thanked: 16 times
Dream Kudos: 575
My Contributions
This Seems to be ASP.Net code so you should post it in ASP.NET Forum for better attention of the experts.

Please use Code Tags while posting code.
Example: IPB Image
User is offlineProfile CardPM
+Quote Post

Jayman
RE: A Page Opens Without Logging In If We Directly Type The Address
8 Aug, 2008 - 02:42 PM
Post #3

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 6,941



Thanked: 42 times
Dream Kudos: 500
Expert In: C#, VB.NET, Java

My Contributions
Moved to ASP.NET.

I would suggest creating a session variable to hold the user id or username. Check if the session is null on any page but the login page. If it is NULL, then redirect the user to the login page.
User is offlineProfile CardPM
+Quote Post

divyapagidela
RE: A Page Opens Without Logging In If We Directly Type The Address
13 Aug, 2008 - 01:06 AM
Post #4

New D.I.C Head
*

Joined: 22 Jul, 2008
Posts: 15



Thanked: 1 times
My Contributions
QUOTE(jayman9 @ 8 Aug, 2008 - 03:42 PM) *

Moved to ASP.NET.

I would suggest creating a session variable to hold the user id or username. Check if the session is null on any page but the login page. If it is NULL, then redirect the user to the login page.



Hiiiiiiiiiiiii
To avoid this problem use sessions
I'll will give u the code for login page using sessions
Hope this may helps u

{Admin edit: code removed until OP shows an effort.}


Try to run the above application,Then u can understand the benfits of sessions
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 03:03PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month