Jump to content

verify sessionID

Recommended Posts

I have a windows application that is calling a web server. Here is my scenario.

1) The windows app calls the webserver for authentication. If authenticated, the webserver will send back the session Id to windows app.

2) Once is authenticated, the windows app will make another call to webserver to get some value by sending the session Id.

3) The  web server will check if the session Id exists. If yes, that means the windows app was authenticated and the web server can send back the data.


So I need to check if the session ID exists. I don't know how. Any idea?

Link to post
Share on other sites

Well, how are you generating and storing the ID in the first place?  It seems pretty trivial to store a piece of data in a certain place and then check the same place to see if that data is there or not, I'm not sure what you're missing.

Link to post
Share on other sites

Probably not automatically through .NET (it is .NET, not IIS, that manages session state), but I suppose you can figure out where it stores them and look them up that way.  I don't know why that's necessary though, this is all handled automatically.  When the session times out it is deleted.  I don't know how .NET handles sessions specifically, but I imagine that if you try to start a session then it will either look for an ID for an existing valid session, or start a new empty session otherwise.  Your web service can have some method that can look at the session to determine if it is a new empty session or if there is data there, and return that information to your other application.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...