Hello

I have a log-on page and after a successful log-on, the user is redirected to userpage.aspx.

I am reading up on 'Session' at the moment to prevent the user from bookmarking userpage.aspx to avoid logging-on in the future. In other words, I want to oblige the user to log-on first before he is able to access userpage.aspx.

Does the code for 'Session' go in myLogon.aspx.vb just as the user is redirected - in other words, does 'Session' kick-in at the moment of redirection - or is the code for 'Session' placed in userpage.aspx.vb?

Thank you.

You set the session variable at the point the user has successfully logged in and before you redirect them to the user page i.e. the moment they have correctly proven they can log in.
Then in the userpage load function you check for the logged in session variable. If it doesn't exist then redirect them to the log in page.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.