Skip to content

fix: don't require SERVERID cookie for a valid VTOP session - #342

Merged
theg1239 merged 1 commit into
ACM-VIT:devfrom
Sarthak90210:fix/serverid-optional
Nov 20, 2026
Merged

theg1239 merged 1 commit into
ACM-VIT:devfrom
Sarthak90210:fix/serverid-optional

Conversation

@Sarthak90210

@Sarthak90210 Sarthak90210 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #341

Problem

VTOP no longer sets a SERVERID cookie (only JSESSIONID is returned). Login succeeds and the home page loads, but ValidateCookies, the login validator and the semester-details check still required SERVERID, so the valid session was discarded and every command failed with "Unable to log in".

Change

A session is now treated as valid when CSRF and JSESSIONID are present. SERVERID is still sent in requests when VTOP provides it.

  • helpers/helper.go (ValidateCookies)
  • helpers/login-validator.go
  • helpers/sem-details.go

Testing

  • go vet and go test ./... pass
  • Verified on Windows (v2.12.1 base): login, profile and attendance work against live VTOP

spent a lot of water and tokens to review your slop

RetriggerView in GreptileConfidence Score: 4/5 Tier: plus

The PR appears safe to merge, with a non-blocking request for regression tests.

Fix All in CodexFindings

  1. P2 New session case lacks tests ▶

Summary

The PR allows VTOP sessions without SERVERID.

  • VTOP sessions pass CLI checks without a SERVERID cookie.

Reviews (1) · Last reviewed commit: "fix: don't require SERVERID cookie for a..." · Reviewed by Greptile

VTOP no longer sets a SERVERID cookie; only JSESSIONID is returned.
ValidateCookies, the login validator and the semester-details check
still required SERVERID, so every successful login was discarded and
users saw "Unable to log in" even with correct credentials.

Treat a session as valid when CSRF and JSESSIONID are present.
@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5f64c33a-2de8-4eaa-a5cb-326ab3e30734

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Comment thread helpers/helper.go

func ValidateCookies(cookies types.Cookies) bool {
return cookies.CSRF != "" && cookies.JSESSIONID != "" && cookies.SERVERID != ""
return cookies.CSRF != "" && cookies.JSESSIONID != ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 New session case lacks tests

The new SERVERID-free session case has no automated regression test. Existing refresh tests still supply SERVERID, so restoring the old requirement could break commands again without failing those tests.

Add tests for ValidateCookies, ValidateLogin, and GetSemDetails: accept CSRF plus JSESSIONID without SERVERID, and still reject either required value being empty. Exercise GetSemDetails without a cached result.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex Fix in Claude Code Fix in Cursor

@theg1239
theg1239 merged commit 665ae31 into ACM-VIT:dev Nov 20, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants